feat: refactor super admin to use is_super_admin flag and enhance site deletion logic
- Changed super admin detection from role-based to `is_super_admin` flag in AdminUser model
- Added `requireDefaultAdminSiteId()` method to throw validation error when no integration site exists
- Enhanced site deletion to migrate platform role bindings to fallback site and auto-delete site-specific admin accounts
- Made agent line code optional with auto-generation fallback using `{site_code}-agent-{counter}` format
This commit is contained in:
@@ -49,7 +49,7 @@ test('platform role index only lists fixed super_admin and agent roles', functio
|
||||
->pluck('slug')
|
||||
->all();
|
||||
|
||||
expect($slugs)->toBe(['super_admin', 'agent']);
|
||||
expect($slugs)->toBe(['super_admin', 'site_admin', 'agent']);
|
||||
});
|
||||
|
||||
test('platform roles cannot be created and super_admin permissions are full catalog', function (): void {
|
||||
|
||||
Reference in New Issue
Block a user