Added the support for generating docs from template doc
This commit is contained in:
@@ -7,34 +7,33 @@
|
||||
|
||||
class ArchiveSettingPolicy
|
||||
{
|
||||
protected function isAdmin(User $user): bool
|
||||
protected function canManage(User $user): bool
|
||||
{
|
||||
// Placeholder: adjust to real permission system / role flag
|
||||
return (bool) ($user->is_admin ?? false);
|
||||
return $user->hasPermission('manage-settings') || $user->hasRole(['admin']);
|
||||
}
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->canManage($user);
|
||||
}
|
||||
|
||||
public function view(User $user, ArchiveSetting $setting): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->canManage($user);
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->canManage($user);
|
||||
}
|
||||
|
||||
public function update(User $user, ArchiveSetting $setting): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->canManage($user);
|
||||
}
|
||||
|
||||
public function delete(User $user, ArchiveSetting $setting): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->canManage($user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user