feat: view and edit comments of uploaded documents

addresses #869eg7tv1
This commit is contained in:
Björn Fromme
2026-08-13 17:20:17 +02:00
parent 44fab8bf6c
commit 644bfa225d
5 changed files with 109 additions and 2 deletions
+3 -2
View File
@@ -14,6 +14,7 @@ class UploadVoter extends Voter
public const DELETE = 'DELETE';
public const DOWNLOAD = 'DOWNLOAD';
public const CHECK = 'CHECK';
public const COMMENT = 'COMMENT';
public function __construct(private readonly Security $security)
{
@@ -25,7 +26,7 @@ class UploadVoter extends Voter
return false;
}
return in_array($attribute, [static::VIEW, static::DELETE, static::DOWNLOAD, static::CHECK]);
return in_array($attribute, [static::VIEW, static::DELETE, static::DOWNLOAD, static::CHECK, static::COMMENT]);
}
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
@@ -35,7 +36,7 @@ class UploadVoter extends Voter
// Administrative users have full access
if (true === $this->security->isGranted('ROLE_ADMINISTRATIVE')) {
if (true === in_array($attribute, [static::VIEW, static::DELETE, static::DOWNLOAD])) {
if (true === in_array($attribute, [static::VIEW, static::DELETE, static::DOWNLOAD, static::COMMENT])) {
return true;
}