Explorar o código

Merge pull request #12420 from kunalaswani/HPCC-21863

HPCC-21863 ECLWatch checks new flag to identify LDAP Admin

Reviewed-By: Miguel Vazquez <miguel.vazquez@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=6) %!d(string=hai) anos
pai
achega
10f6068414
Modificáronse 1 ficheiros con 21 adicións e 10 borrados
  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;
+                                    }
+                                });
+                            }
                         }
                     });
                 }