41 lines
850 B
PHP
41 lines
850 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\ArchiveSetting;
|
|
use App\Models\User;
|
|
|
|
class ArchiveSettingPolicy
|
|
{
|
|
protected function isAdmin(User $user): bool
|
|
{
|
|
// Placeholder: adjust to real permission system / role flag
|
|
return (bool) ($user->is_admin ?? false);
|
|
}
|
|
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $this->isAdmin($user);
|
|
}
|
|
|
|
public function view(User $user, ArchiveSetting $setting): bool
|
|
{
|
|
return $this->isAdmin($user);
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $this->isAdmin($user);
|
|
}
|
|
|
|
public function update(User $user, ArchiveSetting $setting): bool
|
|
{
|
|
return $this->isAdmin($user);
|
|
}
|
|
|
|
public function delete(User $user, ArchiveSetting $setting): bool
|
|
{
|
|
return $this->isAdmin($user);
|
|
}
|
|
}
|