mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Merge pull request #971 from ywk253100/161028_fix_961
User can not be deleted in LDAP authentication mode.
This commit is contained in:
commit
171b17b202
@ -241,6 +241,12 @@ func (ua *UserAPI) Delete() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO read from conifg
|
||||||
|
authMode := os.Getenv("AUTH_MODE")
|
||||||
|
if authMode == "ldap_auth" {
|
||||||
|
ua.CustomAbort(http.StatusForbidden, "user can not be deleted in LDAP authentication mode")
|
||||||
|
}
|
||||||
|
|
||||||
if ua.currentUserID == ua.userID {
|
if ua.currentUserID == ua.userID {
|
||||||
ua.CustomAbort(http.StatusForbidden, "can not delete yourself")
|
ua.CustomAbort(http.StatusForbidden, "can not delete yourself")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user