mirror of
https://github.com/goharbor/harbor
synced 2025-04-10 11:39:18 +00:00
If current user is in the group defined ldap_group_admin_dn, it doesn't have the harbor admin role.
The current solution only fix the /api/users/currentuser, but for /api/users/:id it can display the real information. see issue #5620 Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
11f79e369c
commit
764c43c995
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user