mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable more risky rules.
This commit is contained in:
@@ -20,6 +20,8 @@ use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Description of EventVoter.
|
||||
@@ -86,7 +88,7 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Event && in_array($attribute, self::ROLES))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
|
@@ -20,6 +20,8 @@ use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
@@ -83,7 +85,7 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Participation && in_array($attribute, self::ROLES))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE]))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user