refactor: update user roles and permissions for new role

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2022-10-21 15:06:00 +01:00
parent 8c592bd82d
commit 9056ee131f
3 changed files with 18 additions and 7 deletions

View File

@@ -42,6 +42,10 @@ class PermissionSeeder extends Seeder
]
);
$staff = Role::create([
'name' => 'staff'
]);
$reviewer = Role::create(
[
'name' => 'reviewer'
@@ -108,15 +112,18 @@ class PermissionSeeder extends Seeder
'profiles.view.others'
]);
// Able to view applications and vote on them once they reach the right stage, but not approve applications up to said stage
$reviewer->givePermissionTo([
'applications.view.all',
'applications.vote',
$staff->givePermissionTo([
'reviewer.viewAbsence',
'reviewer.requestAbsence',
'reviewer.withdrawAbsence',
]);
// Able to view applications and vote on them once they reach the right stage, but not approve applications up to said stage
$reviewer->givePermissionTo([
'applications.view.all',
'applications.vote'
]);
$hiringManager->givePermissionTo('appointments.*', 'applications.*', 'admin.hiring.*');
$admin->givePermissionTo([