This commit is contained in:
Adrian Hopek
2022-03-07 14:43:40 +01:00
parent 78d209dc3e
commit 069109c4b0
4 changed files with 74 additions and 53 deletions

View File

@@ -36,7 +36,7 @@ class DashboardController extends Controller
)
->get();
if ($user->role !== Role::Employee) {
if ($user->can("listAll", VacationRequest::class)) {
$vacationRequests = VacationRequest::query()
->states(VacationRequestStatesRetriever::waitingForUserActionStates($user))
->latest("updated_at")
@@ -72,6 +72,9 @@ class DashboardController extends Controller
"pending" => $pending,
"other" => $other,
],
"can" => [
"listAllVacationRequests" => $user->can("listAll", VacationRequest::class),
]
]);
}
}