diff --git a/ui/daignostics.go b/ui/daignostics.go index 31f68250..8adb7cc8 100644 --- a/ui/daignostics.go +++ b/ui/daignostics.go @@ -151,12 +151,16 @@ func aclsTest(w http.ResponseWriter, r *http.Request) { return } - acl := data.GetEffectiveAcl(username) - b, _ := json.MarshalIndent(acl, "", " ") + acl := "" + if username != "" { + b, _ := json.MarshalIndent(data.GetEffectiveAcl(username), "", " ") + acl = string(b) + } d := struct { Page AclString string + Username string }{ Page: Page{ @@ -167,7 +171,8 @@ func aclsTest(w http.ResponseWriter, r *http.Request) { ServerID: serverID, ClusterState: clusterState, }, - AclString: string(b), + AclString: acl, + Username: username, } renderDefaults(w, r, d, "diagnostics/acl_tester.html") diff --git a/ui/templates/diagnostics/acl_tester.html b/ui/templates/diagnostics/acl_tester.html index 7513b35f..cbce0001 100644 --- a/ui/templates/diagnostics/acl_tester.html +++ b/ui/templates/diagnostics/acl_tester.html @@ -9,15 +9,24 @@