allow to edit notification

This commit is contained in:
2021-12-29 15:24:52 +01:00
parent 478c3b3247
commit 9d638fe897
5 changed files with 70 additions and 6 deletions

View File

@@ -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");
}