add policies
This commit is contained in:
1 parent
e9e9f7dbd5
commit
711b5373da
14 files changed
+911
-3
No files matched your search
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Card\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Modules\Card\Models\Card;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CardPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Card');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('View:Card');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Card');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('Update:Card');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('Delete:Card');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('Restore:Card');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Card');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Card');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Card');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Card $card): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Card');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Card');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user