mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Update authorize methods on billing subscription requests
This commit is contained in:
parent
868b6efd8e
commit
83b23956f6
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests\BillingSubscription;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\BillingSubscription;
|
||||
|
||||
class CreateBillingSubscriptionRequest extends Request
|
||||
{
|
||||
@ -13,8 +14,7 @@ class CreateBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
// return auth()->user()->can('create', BillingSubscription::class); // TODO
|
||||
return auth()->user()->can('create', BillingSubscription::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ class DestroyBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true; // TODO
|
||||
return auth()->user()->can('edit', $this->billing_subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,9 +14,7 @@ class EditBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
|
||||
// return auth()->user()->can('view', $this->billing_subscription); // TODO
|
||||
return auth()->user()->can('edit', $this->billing_subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,8 +14,7 @@ class ShowBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return true;
|
||||
// return auth()->user()->can('view', $this->billing_subscription); // TODO
|
||||
return auth()->user()->can('view', $this->billing_subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests\BillingSubscription;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\BillingSubscription;
|
||||
|
||||
class StoreBillingSubscriptionRequest extends Request
|
||||
{
|
||||
@ -13,7 +14,7 @@ class StoreBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true; // TODO
|
||||
return auth()->user()->can('create', BillingSubscription::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@ class UpdateBillingSubscriptionRequest extends Request
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true; // TODO
|
||||
return auth()->user()->can('edit', $this->billing_subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user