mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-28 13:27:31 +02:00
user can not be deleted in LDAP authentication mode
This commit is contained in:
parent
ce40b26ff2
commit
8fe0a333a8
@ -241,6 +241,12 @@ func (ua *UserAPI) Delete() {
|
||||
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 {
|
||||
ua.CustomAbort(http.StatusForbidden, "can not delete yourself")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user