cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:37:57 +01:00
parent c8195e6df5
commit a9188355c5
193 changed files with 306 additions and 63 deletions

View File

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

View File

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