Merge pull request #5612 from stonezdj/fix_ldap_group_admin_dn

Fix issue ldap_group_admin_dn doesn't take effect(master)
This commit is contained in:
Daniel Jiang 2018-08-15 15:42:06 +08:00 committed by GitHub
commit 2e4295ba52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,6 +116,9 @@ func (ua *UserAPI) Get() {
ua.CustomAbort(http.StatusInternalServerError, "Internal error.")
}
u.Password = ""
if ua.userID == ua.currentUserID {
u.HasAdminRole = ua.SecurityCtx.IsSysAdmin()
}
ua.Data["json"] = u
ua.ServeJSON()
return