updates to UI and add archiving option
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user