Symfony2 API
Class

Symfony\Component\Security\Acl\Dbal\MutableAclProvider

class MutableAclProvider extends AclProvider implements MutableAclProviderInterface, PropertyChangedListener

An implementation of the MutableAclProviderInterface using Doctrine DBAL.

Constants

MAX_BATCH_SIZE

Methods

__construct(Connection $connection, PermissionGrantingStrategyInterface $permissionGrantingStrategy, array $options, AclCacheInterface $cache = null)

Constructor.

array findChildren(ObjectIdentityInterface $parentOid, Boolean $directChildrenOnly = false)

Retrieves all child object identities from the database

from AclProvider
AclInterface findAcl(ObjectIdentityInterface $oid, array $sids = array())

Returns the ACL that belongs to the given object identity

from AclProvider
SplObjectStorage findAcls(array $oids, array $sids = array())

Returns the ACLs that belong to the given object identities

MutableAclInterface createAcl(ObjectIdentityInterface $oid)

Creates a new ACL for the given object identity.

deleteAcl(ObjectIdentityInterface $oid)

Deletes the ACL for a given object identity.

propertyChanged(mixed $sender, string $propertyName, mixed $oldValue, mixed $newValue)

Implementation of PropertyChangedListener

updateAcl(MutableAclInterface $acl)

Persists any changes which were made to the ACL, or any associated access control entries.

Details

at line 41
public __construct(Connection $connection, PermissionGrantingStrategyInterface $permissionGrantingStrategy, array $options, AclCacheInterface $cache = null)

Constructor.

Parameters

Connection $connection
PermissionGrantingStrategyInterface $permissionGrantingStrategy
array $options
AclCacheInterface $cache

in AclProvider at line 69
public array findChildren(ObjectIdentityInterface $parentOid, Boolean $directChildrenOnly = false)

Retrieves all child object identities from the database

Parameters

ObjectIdentityInterface $parentOid
Boolean $directChildrenOnly

Return Value

array returns an array of child 'ObjectIdentity's

in AclProvider at line 84
public AclInterface findAcl(ObjectIdentityInterface $oid, array $sids = array())

Returns the ACL that belongs to the given object identity

Parameters

ObjectIdentityInterface $oid
array $sids

Return Value

AclInterface

Exceptions

AclNotFoundException when there is no ACL

at line 114
public SplObjectStorage findAcls(array $oids, array $sids = array())

Returns the ACLs that belong to the given object identities

Parameters

array $oids an array of ObjectIdentityInterface implementations
array $sids an array of SecurityIdentityInterface implementations

Return Value

SplObjectStorage mapping the passed object identities to ACLs

Exceptions

AclNotFoundException when we cannot find an ACL for all identities

at line 51
public MutableAclInterface createAcl(ObjectIdentityInterface $oid)

Creates a new ACL for the given object identity.

Parameters

ObjectIdentityInterface $oid

Return Value

MutableAclInterface

Exceptions

AclAlreadyExistsException when there already is an ACL for the given object identity

at line 78
public deleteAcl(ObjectIdentityInterface $oid)

Deletes the ACL for a given object identity.

This will automatically trigger a delete for any child ACLs. If you don't
want child ACLs to be deleted, you will have to set their parent ACL to null.

Parameters

ObjectIdentityInterface $oid

at line 153
public propertyChanged(mixed $sender, string $propertyName, mixed $oldValue, mixed $newValue)

Implementation of PropertyChangedListener

This allows us to keep track of which values have been changed, so we don't
have to do a full introspection when ->updateAcl() is called.

Parameters

mixed $sender
string $propertyName
mixed $oldValue
mixed $newValue

Exceptions

InvalidArgumentException

at line 221
public updateAcl(MutableAclInterface $acl)

Persists any changes which were made to the ACL, or any associated access control entries.

Changes to parent ACLs are not persisted.

Parameters

MutableAclInterface $acl