mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
allow to edit notification
This commit is contained in:
@@ -22,9 +22,9 @@ final class NotificationVoter extends Voter
|
||||
{
|
||||
public const COMMENT_EDIT = 'CHILL_MAIN_NOTIFICATION_COMMENT_EDIT';
|
||||
|
||||
public const SEE = 'chill_main_notification_see';
|
||||
public const SEE = 'CHILL_MAIN_NOTIFICATION_SEE';
|
||||
|
||||
public const UPDATE = 'chill_main_notification_update';
|
||||
public const UPDATE = 'CHILL_MAIN_NOTIFICATION_UPDATE';
|
||||
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
@@ -48,6 +48,9 @@ final class NotificationVoter extends Voter
|
||||
case self::SEE:
|
||||
return $subject->getSender() === $user || $subject->getAddressees()->contains($user);
|
||||
|
||||
case self::UPDATE:
|
||||
return $subject->getSender() === $user;
|
||||
|
||||
default:
|
||||
throw new UnexpectedValueException("this subject {$attribute} is not implemented");
|
||||
}
|
||||
|
Reference in New Issue
Block a user