1
0
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:
Benjamin Beganović 2021-03-09 14:29:57 +01:00
parent 868b6efd8e
commit 83b23956f6
6 changed files with 8 additions and 10 deletions

View File

@ -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);
}
/**

View File

@ -14,7 +14,7 @@ class DestroyBillingSubscriptionRequest extends Request
*/
public function authorize()
{
return true; // TODO
return auth()->user()->can('edit', $this->billing_subscription);
}
/**

View File

@ -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);
}
/**

View File

@ -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);
}
/**

View File

@ -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);
}
/**

View File

@ -16,7 +16,7 @@ class UpdateBillingSubscriptionRequest extends Request
*/
public function authorize()
{
return true; // TODO
return auth()->user()->can('edit', $this->billing_subscription);
}
/**