public function vote(Token $token, $target, array $attributes) { if (null === $target) { return self::ACCESS_ABSTAIN; } $targetIdentity = $this->aclProvider->extractTargetIdentity($target); if (!$this->supportsClass($targetIdentity->getClassName())) { $this->debug('Target identity not supported. Abstaining.'); return self::ACCESS_ABSTAIN; } $permissionsLists = array_map(array($this->permissionMap, 'getPermissions'), $attributes); $permissions = array_reduce($permissionsLists, 'array_merge', array()); $permissions = array_unique($permissions); if (0 === count($permissions)) { $this->debug('Attribute set not supported or unknown. Abstaining.'); return self::ACCESS_ABSTAIN; } $grantees = array_merge(array($token), $token->getRoles()); return $this->strategy->isGranted($this->aclProvider, $grantees, $targetIdentity, $permissions); }
protected function isACLEmpty(array $grantees, AclTargetIdentity $target) { return 0 === count($this->aclProvider->searchAces($grantees, $target)); }