mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 09:08:26 +01:00
sys admin can not delete himself
This commit is contained in:
parent
77448551ee
commit
5079a8d20c
@ -239,6 +239,11 @@ func (ua *UserAPI) Delete() {
|
||||
ua.RenderError(http.StatusForbidden, "User does not have admin role")
|
||||
return
|
||||
}
|
||||
|
||||
if ua.currentUserID == ua.userID {
|
||||
ua.CustomAbort(http.StatusForbidden, "can not delete yourself")
|
||||
}
|
||||
|
||||
var err error
|
||||
err = dao.DeleteUser(ua.userID)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user