test: implement role-based access control tests and user management module structure

This commit is contained in:
Ajjj
2026-08-04 11:57:47 +08:00
parent a2ea56efa9
commit 3c1cd2dada
4 changed files with 92 additions and 10 deletions

View File

@@ -58,9 +58,12 @@ class UserController extends Controller
$nextNumber = $last ? ((int) substr($last, 4)) + 1 : 1;
$nextCode = 'EMP-' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
$roles = \Spatie\Permission\Models\Role::orderBy('name')->pluck('name');
return Inertia::render('UserManagement::Users/Create', [
'isSuperAdmin' => $isSuperAdmin,
'nextEmployeeCode' => $nextCode,
'roles' => $roles,
'contractors' => $isSuperAdmin
? Contractor::where('status', 'active')
->orderBy('company_name')