Symfony2 API
Class

Symfony\Component\Security\Acl\Voter\AclVoter

class AclVoter implements VoterInterface

This voter can be used as a base class for implementing your own permissions.

Methods

__construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null, $allowIfObjectIdentityUnavailable = true)

Boolean supportsAttribute(string $attribute)

Checks if the voter supports the given attribute.

integer vote(TokenInterface $token, object $object, array $attributes)

Returns the vote for the given parameters.

Boolean supportsClass(string $class)

Checks if the voter supports the given class.

Details

at line 39
public __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null, $allowIfObjectIdentityUnavailable = true)

Parameters

AclProviderInterface $aclProvider
ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy
SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy
PermissionMapInterface $permissionMap
LoggerInterface $logger
$allowIfObjectIdentityUnavailable

at line 49
public Boolean supportsAttribute(string $attribute)

Checks if the voter supports the given attribute.

Parameters

string $attribute An attribute

Return Value

Boolean true if this Voter supports the attribute, false otherwise

at line 54
public integer vote(TokenInterface $token, object $object, array $attributes)

Returns the vote for the given parameters.

This method must return one of the following constants:
ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.

Parameters

TokenInterface $token A TokenInterface instance
object $object The object to secure
array $attributes An array of attributes associated with the method being invoked

Return Value

integer either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED

at line 139
public Boolean supportsClass(string $class)

Checks if the voter supports the given class.

Parameters

string $class The class name

Return Value

Boolean if this Voter can process the class