feat: add super-admin role with admin impersonation support
Add a new super-admin role that can impersonate other admins. Regular admins retain all existing permissions but cannot impersonate other admins or promote users to super-admin. Backend changes: - Add isSuperAdmin field to users table with default false - Add isSuperAdmin() check function to auth service - Update JWT tokens to include isSuperAdmin claim - Allow super-admins to impersonate other admins - Add security rules for super-admin role changes Frontend changes: - Display "Super Admin" badge with gradient styling - Add "Super Admin" option to role change modal - Enable impersonate button for super-admins targeting admins - Add "Super Admins Only" filter option Security rules: - Only super-admins can promote/demote super-admins - Regular admins cannot promote users to super-admin - Super-admins cannot demote themselves - Cannot demote the last super-admin Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,13 @@
|
||||
"when": 1768989260562,
|
||||
"tag": "0003_tired_warpath",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "6",
|
||||
"when": 1769171258085,
|
||||
"tag": "0004_overrated_havok",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user