feat: implement core ERP modules, multi-tenant architecture, and comprehensive system workflow documentation.
This commit is contained in:
@@ -93,7 +93,14 @@ class ContractorController extends Controller
|
||||
'must_change_password' => true,
|
||||
]);
|
||||
|
||||
$role = Role::firstOrCreate(['name' => 'Contractor']);
|
||||
// Provision the account with the role that owns user-management
|
||||
// actions. Keep the legacy Contractor role only for existing
|
||||
// accounts; new contractor admins must use the admin role.
|
||||
$roleName = $contractor->parent_id
|
||||
? 'Sub Contractor Admin'
|
||||
: 'Main Contractor Admin';
|
||||
$role = Role::firstOrCreate(['name' => $roleName]);
|
||||
$role->givePermissionTo('users.access');
|
||||
$user->assignRole($role);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user