mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
fix error in list rendering page
This commit is contained in:
parent
4e6e02e753
commit
c72813557b
@ -64,14 +64,16 @@ class PersonVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($attribute === self::STATS and !$object instanceof \Chill\MainBundle\Entity\Center) {
|
if ($object instanceof \Chill\MainBundle\Entity\Center) {
|
||||||
throw new \LogicException("the expected type is \Chill\MainBundle\Entity\Center for "
|
if (! \in_array($attribute, [ self::STATS, self::LISTS ])) {
|
||||||
. "role ".self::STATS." ".get_class($object)." given.");
|
throw new \LogicException("the expected type is \Chill\MainBundle\Entity\Center for "
|
||||||
}
|
. "role, '".$attribute." ".get_class($object)."' given.");
|
||||||
|
}
|
||||||
if ($attribute !== self::STATS and !$object instanceof \Chill\PersonBundle\Entity\Person) {
|
} elseif ($object instanceof \Chill\PersonBundle\Entity\Person) {
|
||||||
throw new \LogicException("the expected type is \Chill\PersonBundle\Entity\Person for "
|
if (\in_array($attribute, [ self::STATS, self::LISTS ])){
|
||||||
. "role ".$attribute." ".get_class($object)." given.");
|
throw new \LogicException("the expected type is \Chill\PersonBundle\Entity\Person for "
|
||||||
|
. "role, '".$attribute." ".get_class($object)."' given.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->helper->userHasAccess($user, $object, $attribute);
|
return $this->helper->userHasAccess($user, $object, $attribute);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user