This commit is contained in:
2025-10-22 20:08:22 +05:00
commit 736e3bef18
2573 changed files with 120385 additions and 0 deletions

View File

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