diff --git a/app/Infrastructure/Http/Requests/CreateVacationRequestRequest.php b/app/Infrastructure/Http/Requests/CreateVacationRequestRequest.php index 09df042..3faec54 100644 --- a/app/Infrastructure/Http/Requests/CreateVacationRequestRequest.php +++ b/app/Infrastructure/Http/Requests/CreateVacationRequestRequest.php @@ -13,8 +13,8 @@ class CreateVacationRequestRequest extends FormRequest public function authorize(): bool { - return null === $this->get("user") || - (int)$this->get("user") === $this->user()->id || + return ($this->get("user") === null) || + ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); }