From 646091f89e1cabd9fb3f451b904d63bcc2e11048 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 10 Jun 2022 15:15:26 +1000 Subject: [PATCH] Fixes for quote form request --- app/Http/Requests/ClientPortal/Invoices/ShowInvoiceRequest.php | 2 +- app/Http/Requests/ClientPortal/Quotes/ShowQuoteRequest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/ClientPortal/Invoices/ShowInvoiceRequest.php b/app/Http/Requests/ClientPortal/Invoices/ShowInvoiceRequest.php index 01be13261dac..f9573fd1c3e3 100644 --- a/app/Http/Requests/ClientPortal/Invoices/ShowInvoiceRequest.php +++ b/app/Http/Requests/ClientPortal/Invoices/ShowInvoiceRequest.php @@ -23,7 +23,7 @@ class ShowInvoiceRequest extends Request */ public function authorize() : bool { - return auth()->guard('contact')->user()->client_id === $this->invoice->client_id + return auth()->guard('contact')->user()->client_id === (int)$this->invoice->client_id && auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES; } } diff --git a/app/Http/Requests/ClientPortal/Quotes/ShowQuoteRequest.php b/app/Http/Requests/ClientPortal/Quotes/ShowQuoteRequest.php index ee324417440c..a510377f322d 100644 --- a/app/Http/Requests/ClientPortal/Quotes/ShowQuoteRequest.php +++ b/app/Http/Requests/ClientPortal/Quotes/ShowQuoteRequest.php @@ -19,7 +19,7 @@ class ShowQuoteRequest extends FormRequest { public function authorize() { - return auth()->guard('contact')->user()->client->id === $this->quote->client_id + return auth()->guard('contact')->user()->client->id === (int)$this->quote->client_id && auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES; }