You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by rf...@apache.org on 2023/12/21 17:56:54 UTC
(nifi) branch support/nifi-1.x updated: NIFI-12481: Filtering out unauthorized registry clients to avoid unhandled error (#8147)
This is an automated email from the ASF dual-hosted git repository.
rfellows pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
new e8e547a00c NIFI-12481: Filtering out unauthorized registry clients to avoid unhandled error (#8147)
e8e547a00c is described below
commit e8e547a00c2e000be345434ad90b855cf0e330d9
Author: Matt Gilman <ma...@gmail.com>
AuthorDate: Thu Dec 21 11:34:57 2023 -0500
NIFI-12481: Filtering out unauthorized registry clients to avoid unhandled error (#8147)
* NIFI-12481:
- Filtering out unauthorized registry clients to avoid unhandled error.
* NIFI-12481:
- Using es5 syntax.
This closes #8147
---
.../src/main/webapp/js/nf/canvas/nf-flow-version.js | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js
index 9588722569..07c8b0207c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js
@@ -198,12 +198,19 @@
}).done(function (registriesResponse) {
var registries = [];
- if (nfCommon.isDefinedAndNotNull(registriesResponse.registries) && registriesResponse.registries.length > 0) {
- registriesResponse.registries.sort(function (a, b) {
+ var authorizedRegistries = [];
+ if (nfCommon.isDefinedAndNotNull(registriesResponse.registries)) {
+ authorizedRegistries = registriesResponse.registries.filter(function(registry) {
+ return registry.permissions.canRead;
+ });
+ }
+
+ if (authorizedRegistries.length > 0) {
+ authorizedRegistries.sort(function (a, b) {
return a.registry.name > b.registry.name;
});
- $.each(registriesResponse.registries, function (_, registryEntity) {
+ $.each(authorizedRegistries, function (_, registryEntity) {
var registry = registryEntity.registry;
registries.push({
text: registry.name,