fix(go): check if user platform role is changing;

This commit is contained in:
VishalDalwadi
2026-03-06 16:09:51 +05:30
parent e1f0a26c20
commit 8422933cfb
+1 -1
View File
@@ -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",