mirror of
https://github.com/apache/nifi.git
synced 2025-02-07 10:38:33 +00:00
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
db919bc494
commit
e8e547a00c
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user