Add policy mappings for VisaMasterPaymentOrder and OnlinePayment models
This commit is contained in:
50
app/Modules/OnlinePayment/Policies/OnlinePaymentPolicy.php
Normal file
50
app/Modules/OnlinePayment/Policies/OnlinePaymentPolicy.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\OnlinePayment\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\OnlinePayment\Models\OnlinePayment;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class OnlinePaymentPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->can('ViewAny:OnlinePayment');
|
||||
}
|
||||
|
||||
public function view(User $user, OnlinePayment $onlinePayment): bool
|
||||
{
|
||||
return $user->can('View:OnlinePayment');
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->can('Create:OnlinePayment');
|
||||
}
|
||||
|
||||
public function update(User $user, OnlinePayment $onlinePayment): bool
|
||||
{
|
||||
return $user->can('Update:OnlinePayment');
|
||||
}
|
||||
|
||||
public function delete(User $user, OnlinePayment $onlinePayment): bool
|
||||
{
|
||||
return $user->can('Delete:OnlinePayment');
|
||||
}
|
||||
|
||||
public function restore(User $user, OnlinePayment $onlinePayment): bool
|
||||
{
|
||||
return $user->can('Restore:OnlinePayment');
|
||||
}
|
||||
|
||||
public function forceDelete(User $user, OnlinePayment $onlinePayment): bool
|
||||
{
|
||||
return $user->can('ForceDelete:OnlinePayment');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user