fix invocation of old method and upgrade ActivitySTatVoter to sf3

This commit is contained in:
2018-04-06 02:42:11 +02:00
parent ea5d3f7940
commit b84a77d9de
2 changed files with 22 additions and 8 deletions

View File

@@ -55,10 +55,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
protected function supports($attribute, $subject)
{
if ($subject instanceof Activity) {
return \in_array($attribute, [
self::CREATE, self::SEE, self::UPDATE, self::DELETE,
self::SEE_DETAILS
]);
return \in_array($attribute, $this->getAttributes());
} else {
return false;
}
@@ -71,11 +68,17 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
}
return $this->helper->userHasAccess($token->getUser(), $subject, $attribute);
}
private function getAttributes()
{
return [ self::CREATE, self::SEE, self::UPDATE, self::DELETE,
self::SEE_DETAILS ];
}
public function getRoles()
{
return $this->getSupportedAttributes();
return $this->getAttributes();
}
public function getRolesWithoutScope()