Browse Source

HPCC-21863 ECLWatch checks new flag to identify LDAP Admin

New flag to check if LDAP Admin added (isLDAPAdmin).

Signed-off-by: Aswani, Kunal <kunal.aswani@lexisnexis.com>
Aswani, Kunal 6 years ago
parent
commit
dc26a03dc3
1 changed files with 21 additions and 10 deletions
  1. 21 10
      esp/src/eclwatch/HPCCPlatformWidget.js

+ 21 - 10
esp/src/eclwatch/HPCCPlatformWidget.js

@@ -286,17 +286,28 @@ define([
                             username: user
                         }
                     }).then(function (response) {
-                        if (lang.exists("UserEditResponse.Groups.Group", response)) {
-                            arrayUtil.some(response.UserEditResponse.Groups.Group, function (item, idx) {
-                                if (item.name === "Administrators" || item.name === "Directory Administrators") {
-                                    dojoConfig.isAdmin = true;
-                                    registry.byId(context.id + "SetBanner").set("disabled", false);
-                                    if (context.widget._OPS.refresh) {
-                                        context.widget._OPS.refresh();
-                                    }
-                                    return false;
+                        if (lang.exists("UserEditResponse.isLDAPAdmin", response)) {
+                            if (response.UserEditResponse.isLDAPAdmin === true){
+                                dojoConfig.isAdmin = true;
+                                registry.byId(context.id + "SetBanner").set("disabled", false);
+                                if (context.widget._OPS.refresh) {
+                                    context.widget._OPS.refresh();
+                                }
+                                return false;
                                 }
-                            });
+                        } else {
+                            if (lang.exists("UserEditResponse.Groups.Group", response)){
+                                arrayUtil.some(response.UserEditResponse.Groups.Group, function (item, idx) {
+                                    if (item.name === "Administrators" || item.name === "Directory Administrators") {
+                                        dojoConfig.isAdmin = true;
+                                        registry.byId(context.id + "SetBanner").set("disabled", false);
+                                        if (context.widget._OPS.refresh) {
+                                            context.widget._OPS.refresh();
+                                        }
+                                        return false;
+                                    }
+                                });
+                            }
                         }
                     });
                 }