From cd537d1889f45467ac8bc24c12852a5455194c4d Mon Sep 17 00:00:00 2001 From: Kamil Niemczycki Date: Mon, 6 Jun 2022 12:47:40 +0200 Subject: [PATCH] Apply suggestion Co-authored-by: Krzysztof Rewak --- .../Http/Requests/CreateVacationRequestRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }