simedkom/app/Policies/AiringProofThemePolicy.php
Yoga Pangestu 28ec50494d feat: Add policies for SubClassification, SubLocation, and User models
- Created SubClassificationPolicy to manage authorization for SubClassification actions.
- Created SubLocationPolicy to manage authorization for SubLocation actions.
- Created UserPolicy to manage authorization for User actions.
- Integrate Filament Shield for role and permission management
- Updated DashboardPanelProvider to include FilamentShieldPlugin.
- Added filament-shield package to composer.json and updated composer.lock.
- Created filament-shield.php configuration file for Shield settings.
- Created permission.php configuration file for Spatie permissions.
- Added migration for creating permission tables.
- Created ShieldSeeder to seed roles and permissions.
- Updated DatabaseSeeder to include ShieldSeeder.
- Updated UserSeeder to assign the Developer role to the created user.
2025-11-20 09:00:59 +07:00

70 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Policies;
use App\Models\AiringProofTheme;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class AiringProofThemePolicy
{
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:AiringProofTheme');
}
public function view(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('View:AiringProofTheme');
}
public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:AiringProofTheme');
}
public function update(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('Update:AiringProofTheme');
}
public function delete(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('Delete:AiringProofTheme');
}
public function restore(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('Restore:AiringProofTheme');
}
public function forceDelete(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('ForceDelete:AiringProofTheme');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:AiringProofTheme');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:AiringProofTheme');
}
public function replicate(AuthUser $authUser, AiringProofTheme $airingProofTheme): bool
{
return $authUser->can('Replicate:AiringProofTheme');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:AiringProofTheme');
}
}