feat: initialize role-based access control (RBAC) system with multi-module UI and administrative management controllers
This commit is contained in:
@@ -93,12 +93,8 @@ class ContractorController extends Controller
|
||||
'must_change_password' => true,
|
||||
]);
|
||||
|
||||
// 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';
|
||||
// Provision every contractor administrator with the single supported contractor role.
|
||||
$roleName = 'Main Contractor Admin';
|
||||
$role = Role::firstOrCreate(['name' => $roleName]);
|
||||
$role->givePermissionTo('users.access');
|
||||
$user->assignRole($role);
|
||||
|
||||
Reference in New Issue
Block a user