cs: Enable a couple of risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-24 12:38:18 +01:00
parent acc4647346
commit f531cdc0ec
51 changed files with 130 additions and 132 deletions

View File

@@ -111,7 +111,7 @@ abstract class AbstractElementController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() and $form->isValid()) {
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->flush();
@@ -146,7 +146,7 @@ abstract class AbstractElementController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() and $form->isValid()) {
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($element);
$em->flush();

View File

@@ -63,7 +63,7 @@ class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierar
protected function supports($attribute, $subject)
{
return (in_array($attribute, self::ROLES) && $subject instanceof AbstractElement)
or ($subject instanceof Person && in_array($attribute, [self::SHOW, self::CREATE]));
|| ($subject instanceof Person && in_array($attribute, [self::SHOW, self::CREATE]));
}
protected function voteOnAttribute($attribute, $subject, \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token)