Added the support for generating docs from template doc

This commit is contained in:
Simon Pocrnjič
2025-10-06 21:46:28 +02:00
parent 0c8d1e0b5d
commit cec5796acf
69 changed files with 4570 additions and 374 deletions
+7 -8
View File
@@ -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);
}
}