feat: view and edit comments of uploaded documents
addresses #869eg7tv1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user