helper = $helper; } public function getRoles() { return $this->getAttributes(); } public function getRolesWithHierarchy() { return ['Activity' => $this->getRoles()]; } public function getRolesWithoutScope() { return $this->getAttributes(); } protected function getSupportedClasses() { return [Center::class]; } protected function isGranted($attribute, $object, $user = null) { if (!$user instanceof \Symfony\Component\Security\Core\User\UserInterface) { return false; } return $this->helper->userHasAccess($user, $object, $attribute); } protected function supports($attribute, $subject) { if ( $subject instanceof Center && in_array($attribute, $this->getAttributes()) ) { return true; } return false; } private function getAttributes() { return [self::STATS, self::LISTS]; } }