#62 - fix
This commit is contained in:
@@ -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),
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -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(),
|
||||
|
Reference in New Issue
Block a user