mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 19:34:33 -04:00
Minor fixes for quote permissions
This commit is contained in:
parent
697b379889
commit
6ec6ae8756
@ -15,7 +15,8 @@ class ShowCreditRequest extends FormRequest
|
|||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return !$this->credit->is_deleted
|
return !$this->credit->is_deleted
|
||||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS;
|
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS
|
||||||
|
&& auth()->guard('contact')->user()->client_id === $this->credit->client_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,9 +27,10 @@ class ShowDocumentRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
|
|
||||||
return auth()->guard('contact')->user()->client_id == $this->document->documentable_id
|
return auth()->guard('contact')->user()->client_id == $this->document->documentable_id
|
||||||
|| $this->document->documentable->client_id == auth()->guard('contact')->user()->client_id
|
|
||||||
|| $this->document->company_id == auth()->guard('contact')->user()->company_id;
|
|| $this->document->company_id == auth()->guard('contact')->user()->company_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ class ShowInvoiceRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize() : bool
|
public function authorize() : bool
|
||||||
{
|
{
|
||||||
return auth()->guard('contact')->user()->client_id == $this->invoice->client_id
|
return auth()->guard('contact')->user()->client_id === $this->invoice->client_id
|
||||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ class ShowQuoteRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return auth()->user()->client->id === $this->quote->client_id
|
return auth()->guard('contact')->user()->client->id === $this->quote->client_id
|
||||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user