<?php
namespace App\Security\Voter\ChatNotification;
use App\Entity\Account\User;
use App\Entity\Channel\Channel;
use App\Entity\ChannelUserData\ChannelUserData;
use App\Security\Voter\AbstractVoter;
class ShowVoter extends AbstractVoter
{
protected function supportedAttribute(): string
{
return 'NIM_NOTIFICATION';
}
protected function grant(User $user, $subject, ChannelUserData $channelUserData): int
{
return true;
}
protected function getChannelUserData(User $user, $subject): ?ChannelUserData
{
return $user->getChannelUserDataByChannel($subject);
}
protected function supportSubject($subject): bool
{
return $subject instanceof Channel;
}
}