diff --git a/app/Infrastructure/Http/Controllers/DashboardController.php b/app/Infrastructure/Http/Controllers/DashboardController.php index 2dc3bed..7044662 100644 --- a/app/Infrastructure/Http/Controllers/DashboardController.php +++ b/app/Infrastructure/Http/Controllers/DashboardController.php @@ -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), + ] ]); } } diff --git a/app/Infrastructure/Http/Resources/UserResource.php b/app/Infrastructure/Http/Resources/UserResource.php index 8d0263c..2428f7f 100644 --- a/app/Infrastructure/Http/Resources/UserResource.php +++ b/app/Infrastructure/Http/Resources/UserResource.php @@ -16,8 +16,7 @@ class UserResource extends JsonResource "id" => $this->id, "name" => $this->fullName, "email" => $this->email, - "displayRole" => $this->role->label(), - "role" => $this->role, + "role" => $this->role->label(), "position" => $this->position, "avatar" => $this->getAvatar(), "deleted" => $this->trashed(), diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index a42ff35..62e0745 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -21,7 +21,7 @@ {{ user.name }}
- {{ user.displayRole }} + {{ user.role }}
@@ -97,54 +97,7 @@- {{ request.from }} - {{ request.to }} -
-
-
+ Brak danych +
++ {{ request.from }} - {{ request.to }} +
+
+
+ Brak danych +
++ Brak danych +
+