feat: implement core ERP modules, multi-tenant architecture, and comprehensive system workflow documentation.

This commit is contained in:
Ajjj
2026-08-05 01:18:31 +08:00
parent 1fcb468dc1
commit c03de704e2
46 changed files with 1902 additions and 387 deletions

View File

@@ -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);
}
});