some data in msgraph synchro and answer on calendar invite

This commit is contained in:
2022-05-26 19:25:59 +02:00
parent 59a64e9a62
commit 7c0bdc5abe
7 changed files with 433 additions and 257 deletions

View File

@@ -0,0 +1,35 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Security\Voter;
use Chill\CalendarBundle\Entity\Invite;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class InviteVoter extends Voter
{
public const ANSWER = 'CHILL_CALENDAR_INVITE_ANSWER';
protected function supports($attribute, $subject): bool
{
return $subject instanceof Invite && self::ANSWER === $attribute;
}
/**
* @param string $attribute
* @param Invite $subject
*/
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
{
return $token->getUser() === $subject->getUser();
}
}