mirror of https://github.com/apache/nifi.git
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
This commit is contained in:
parent
e6d09c3b3d
commit
1f54d5d1fc
|
@ -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.component.name > b.component.name;
|
||||
});
|
||||
|
||||
$.each(registriesResponse.registries, function (_, registryEntity) {
|
||||
$.each(authorizedRegistries, function (_, registryEntity) {
|
||||
var registry = registryEntity.component;
|
||||
registries.push({
|
||||
text: registry.name,
|
||||
|
|
Loading…
Reference in New Issue