mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
don't allow admins to change their own permissions
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -149,8 +149,8 @@ func updateAdmin(w http.ResponseWriter, r *http.Request) {
|
||||
http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if claims.isCriticalPermRemoved(updatedAdmin.Permissions) {
|
||||
sendAPIResponse(w, r, errors.New("you cannot remove these permissions to yourself"), "", http.StatusBadRequest)
|
||||
if !util.SlicesEqual(admin.Permissions, updatedAdmin.Permissions) {
|
||||
sendAPIResponse(w, r, errors.New("you cannot change your permissions"), "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if updatedAdmin.Status == 0 {
|
||||
|
||||
Reference in New Issue
Block a user