mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Update CreateInvoiceRequest.php
This commit is contained in:
parent
942b06f999
commit
741e90462a
@ -13,7 +13,17 @@ class CreateInvoiceRequest extends InvoiceRequest
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user