mirror of
https://github.com/gravitl/netmaker.git
synced 2026-04-23 00:17:10 +08:00
fix(go): check if user platform role is changing;
This commit is contained in:
+1
-1
@@ -1313,7 +1313,7 @@ func updateUser(w http.ResponseWriter, r *http.Request) {
|
||||
)
|
||||
return
|
||||
}
|
||||
if userchange.PlatformRoleID == models.SuperAdminRole {
|
||||
if user.PlatformRoleID != userchange.PlatformRoleID && userchange.PlatformRoleID == models.SuperAdminRole {
|
||||
err = errors.New("only a super-admin can assign the super-admin role to another user via transferSuperAdmin method")
|
||||
slog.Error(
|
||||
"failed to update user",
|
||||
|
||||
Reference in New Issue
Block a user