1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Update CreateInvoiceRequest.php

This commit is contained in:
David Bomba 2018-07-24 22:29:49 +10:00 committed by GitHub
parent 942b06f999
commit 741e90462a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,17 @@ class CreateInvoiceRequest extends InvoiceRequest
*/ */
public function authorize() public function authorize()
{ {
return $this->user()->can('create', ENTITY_INVOICE); if (request()->input('is_quote'))
return $this->user()->can('create', ENTITY_QUOTE);
else {
if(request()->input('is_recurring'))
$standardOrRecurringInvoice = ENTITY_RECURRING_INVOICE;
else
$standardOrRecurringInvoice = ENTITY_INVOICE;
return $this->user()->can('create', $standardOrRecurringInvoice);
}
} }
/** /**