add policies
This commit is contained in:
70
app/Modules/CardOrder/Policies/CardOrderPolicy.php
Normal file
70
app/Modules/CardOrder/Policies/CardOrderPolicy.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\CardOrder\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Modules\CardOrder\Models\CardOrder;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CardOrderPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:CardOrder');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('View:CardOrder');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:CardOrder');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('Update:CardOrder');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('Delete:CardOrder');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('Restore:CardOrder');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:CardOrder');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:CardOrder');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:CardOrder');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, CardOrder $cardOrder): bool
|
||||
{
|
||||
return $authUser->can('Replicate:CardOrder');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:CardOrder');
|
||||
}
|
||||
|
||||
}
|
||||
70
app/Modules/CardOrder/Policies/CardStatePolicy.php
Normal file
70
app/Modules/CardOrder/Policies/CardStatePolicy.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\CardOrder\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Modules\CardOrder\Models\CardState;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CardStatePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:CardState');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('View:CardState');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:CardState');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('Update:CardState');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('Delete:CardState');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('Restore:CardState');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:CardState');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:CardState');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:CardState');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, CardState $cardState): bool
|
||||
{
|
||||
return $authUser->can('Replicate:CardState');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:CardState');
|
||||
}
|
||||
|
||||
}
|
||||
70
app/Modules/CardOrder/Policies/CardTypePolicy.php
Normal file
70
app/Modules/CardOrder/Policies/CardTypePolicy.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\CardOrder\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Modules\CardOrder\Models\CardType;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CardTypePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:CardType');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('View:CardType');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:CardType');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('Update:CardType');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('Delete:CardType');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('Restore:CardType');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:CardType');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:CardType');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:CardType');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, CardType $cardType): bool
|
||||
{
|
||||
return $authUser->can('Replicate:CardType');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:CardType');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user