diff options
Diffstat (limited to 'Acl')
30 files changed, 105 insertions, 143 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index 75093d9..8413843 100644 --- a/Acl/Dbal/AclProvider.php +++ b/Acl/Dbal/AclProvider.php @@ -348,7 +348,6 @@ QUERY; * This method is called when an ACL instance is retrieved from the cache. * * @param AclInterface $acl - * @return void */ private function updateAceIdentityMap(AclInterface $acl) { @@ -397,8 +396,6 @@ QUERY; * map to ensure every ACE only gets instantiated once. * * @param array &$aces - * - * @return void */ private function doUpdateAceIdentityMap(array &$aces) { diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index 242c2a9..0d46f3a 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -148,7 +148,6 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf * @param string $propertyName * @param mixed $oldValue * @param mixed $newValue - * @return void */ public function propertyChanged($sender, $propertyName, $oldValue, $newValue) { @@ -643,7 +642,6 @@ QUERY; * Creates the ACL for the passed object identity * * @param ObjectIdentityInterface $oid - * @return void */ private function createObjectIdentity(ObjectIdentityInterface $oid) { @@ -695,7 +693,6 @@ QUERY; * Deletes all ACEs for the given object identity primary key. * * @param integer $oidPK - * @return void */ private function deleteAccessControlEntries($oidPK) { @@ -706,7 +703,6 @@ QUERY; * Deletes the object identity from the database. * * @param integer $pk - * @return void */ private function deleteObjectIdentity($pk) { @@ -717,7 +713,6 @@ QUERY; * Deletes all entries from the relations table from the database. * * @param integer $pk - * @return void */ private function deleteObjectIdentityRelations($pk) { @@ -728,7 +723,6 @@ QUERY; * This regenerates the ancestor table which is used for fast read access. * * @param AclInterface $acl - * @return void */ private function regenerateAncestorRelations(AclInterface $acl) { @@ -749,7 +743,6 @@ QUERY; * * @param string $name * @param array $changes - * @return void */ private function updateFieldAceProperty($name, array $changes) { @@ -806,7 +799,6 @@ QUERY; * * @param string $name * @param array $changes - * @return void */ private function updateAceProperty($name, array $changes) { @@ -860,7 +852,6 @@ QUERY; * Persists the changes which were made to ACEs to the database. * * @param \SplObjectStorage $aces - * @return void */ private function updateAces(\SplObjectStorage $aces) { diff --git a/Acl/Dbal/Schema.php b/Acl/Dbal/Schema.php index dd8cf08..fd25926 100644 --- a/Acl/Dbal/Schema.php +++ b/Acl/Dbal/Schema.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Security\Acl\Dbal; use Doctrine\DBAL\Schema\Schema as BaseSchema; +use Doctrine\DBAL\Connection; /** * The schema used for the ACL system. @@ -25,12 +26,14 @@ final class Schema extends BaseSchema /** * Constructor * - * @param array $options the names for tables - * @return void + * @param array $options the names for tables + * @param Connection $connection */ - public function __construct(array $options) + public function __construct(array $options, Connection $connection = null) { - parent::__construct(); + $schemaConfig = null === $connection ? null : $connection->getSchemaManager()->createSchemaConfig(); + + parent::__construct(array(), array(), $schemaConfig); $this->options = $options; @@ -42,9 +45,23 @@ final class Schema extends BaseSchema } /** - * Adds the class table to the schema + * Merges ACL schema with the given schema. * - * @return void + * @param BaseSchema $schema + */ + public function addToSchema(BaseSchema $schema) + { + foreach ($this->getTables() as $table) { + $schema->_addTable($table); + } + + foreach ($this->getSequences() as $sequence) { + $schema->_addSequence($sequence); + } + } + + /** + * Adds the class table to the schema */ protected function addClassTable() { @@ -57,8 +74,6 @@ final class Schema extends BaseSchema /** * Adds the entry table to the schema - * - * @return void */ protected function addEntryTable() { @@ -87,8 +102,6 @@ final class Schema extends BaseSchema /** * Adds the object identity table to the schema - * - * @return void */ protected function addObjectIdentitiesTable() { @@ -104,13 +117,11 @@ final class Schema extends BaseSchema $table->addUniqueIndex(array('object_identifier', 'class_id')); $table->addIndex(array('parent_object_identity_id')); - $table->addForeignKeyConstraint($table, array('parent_object_identity_id'), array('id'), array('onDelete' => 'RESTRICT', 'onUpdate' => 'RESTRICT')); + $table->addForeignKeyConstraint($table, array('parent_object_identity_id'), array('id')); } /** * Adds the object identity relation table to the schema - * - * @return void */ protected function addObjectIdentityAncestorsTable() { @@ -128,8 +139,6 @@ final class Schema extends BaseSchema /** * Adds the security identity table to the schema - * - * @return void */ protected function addSecurityIdentitiesTable() { diff --git a/Acl/Domain/Acl.php b/Acl/Domain/Acl.php index c77dab1..6d53131 100644 --- a/Acl/Domain/Acl.php +++ b/Acl/Domain/Acl.php @@ -55,7 +55,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param PermissionGrantingStrategyInterface $permissionGrantingStrategy * @param array $loadedSids * @param Boolean $entriesInheriting - * @return void */ public function __construct($id, ObjectIdentityInterface $objectIdentity, PermissionGrantingStrategyInterface $permissionGrantingStrategy, array $loadedSids = array(), $entriesInheriting) { @@ -76,7 +75,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * Adds a property changed listener * * @param PropertyChangedListener $listener - * @return void */ public function addPropertyChangedListener(PropertyChangedListener $listener) { @@ -282,7 +280,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * Implementation for the \Serializable interface * * @param string $serialized - * @return void */ public function unserialize($serialized) { @@ -314,9 +311,9 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * {@inheritDoc} */ - public function setParentAcl(AclInterface $acl) + public function setParentAcl(AclInterface $acl = null) { - if (null === $acl->getId()) { + if (null !== $acl && null === $acl->getId()) { throw new \InvalidArgumentException('$acl must have an ID.'); } @@ -404,7 +401,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $property * @param integer $index * @throws \OutOfBoundsException - * @return void */ private function deleteAce($property, $index) { @@ -430,7 +426,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param integer $index * @param string $field * @throws \OutOfBoundsException - * @return void */ private function deleteFieldAce($property, $index, $field) { @@ -460,7 +455,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \OutOfBoundsException * @throws \InvalidArgumentException - * @return void */ private function insertAce($property, $index, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null) { @@ -510,7 +504,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \InvalidArgumentException * @throws \OutOfBoundsException - * @return void */ private function insertFieldAce($property, $index, $field, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null) { @@ -564,7 +557,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param integer $mask * @param string $strategy * @throws \OutOfBoundsException - * @return void */ private function updateAce($property, $index, $mask, $strategy = null) { @@ -592,7 +584,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param Boolean $auditSuccess * @param Boolean $auditFailure * @throws \OutOfBoundsException - * @return void */ private function updateAuditing(array &$aces, $index, $auditSuccess, $auditFailure) { @@ -621,7 +612,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \InvalidArgumentException * @throws \OutOfBoundsException - * @return void */ private function updateFieldAce($property, $index, $field, $mask, $strategy = null) { @@ -651,7 +641,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $name * @param mixed $oldValue * @param mixed $newValue - * @return void */ private function onPropertyChanged($name, $oldValue, $newValue) { @@ -667,7 +656,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $name * @param mixed $oldValue * @param mixed $newValue - * @return void */ private function onEntryPropertyChanged(EntryInterface $entry, $name, $oldValue, $newValue) { diff --git a/Acl/Domain/AclCollectionCache.php b/Acl/Domain/AclCollectionCache.php index 12d7053..be082c1 100644 --- a/Acl/Domain/AclCollectionCache.php +++ b/Acl/Domain/AclCollectionCache.php @@ -32,7 +32,6 @@ class AclCollectionCache * @param AclProviderInterface $aclProvider * @param ObjectIdentityRetrievalStrategy $oidRetrievalStrategy * @param SecurityIdentityRetrievalStrategy $sidRetrievalStrategy - * @return void */ public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy) { @@ -47,7 +46,6 @@ class AclCollectionCache * * @param mixed $collection anything that can be passed to foreach() * @param array $tokens an array of TokenInterface implementations - * @return void */ public function cache($collection, array $tokens = array()) { diff --git a/Acl/Domain/AuditLogger.php b/Acl/Domain/AuditLogger.php index 2a6461c..8174873 100644 --- a/Acl/Domain/AuditLogger.php +++ b/Acl/Domain/AuditLogger.php @@ -27,7 +27,6 @@ abstract class AuditLogger implements AuditLoggerInterface * * @param Boolean $granted * @param EntryInterface $ace - * @return void */ public function logIfNeeded($granted, EntryInterface $ace) { @@ -47,7 +46,6 @@ abstract class AuditLogger implements AuditLoggerInterface * * @param Boolean $granted * @param EntryInterface $ace - * @return void */ abstract protected function doLog($granted, EntryInterface $ace); } diff --git a/Acl/Domain/DoctrineAclCache.php b/Acl/Domain/DoctrineAclCache.php index 21e5149..731f98c 100644 --- a/Acl/Domain/DoctrineAclCache.php +++ b/Acl/Domain/DoctrineAclCache.php @@ -36,8 +36,6 @@ class DoctrineAclCache implements AclCacheInterface * @param Cache $cache * @param PermissionGrantingStrategyInterface $permissionGrantingStrategy * @param string $prefix - * - * @return void */ public function __construct(Cache $cache, PermissionGrantingStrategyInterface $permissionGrantingStrategy, $prefix = self::PREFIX) { diff --git a/Acl/Domain/Entry.php b/Acl/Domain/Entry.php index 9a4f560..42449c4 100644 --- a/Acl/Domain/Entry.php +++ b/Acl/Domain/Entry.php @@ -126,7 +126,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param Boolean $boolean - * @return void */ public function setAuditFailure($boolean) { @@ -140,7 +139,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param Boolean $boolean - * @return void */ public function setAuditSuccess($boolean) { @@ -154,7 +152,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param integer $mask - * @return void */ public function setMask($mask) { @@ -168,7 +165,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param string $strategy - * @return void */ public function setStrategy($strategy) { @@ -197,7 +193,6 @@ class Entry implements AuditableEntryInterface * Implementation of \Serializable * * @param string $serialized - * @return void */ public function unserialize($serialized) { diff --git a/Acl/Domain/FieldEntry.php b/Acl/Domain/FieldEntry.php index 4167ba4..f057367 100644 --- a/Acl/Domain/FieldEntry.php +++ b/Acl/Domain/FieldEntry.php @@ -36,7 +36,6 @@ class FieldEntry extends Entry implements FieldEntryInterface * @param Boolean $granting * @param Boolean $auditFailure * @param Boolean $auditSuccess - * @return void */ public function __construct($id, AclInterface $acl, $field, SecurityIdentityInterface $sid, $strategy, $mask, $granting, $auditFailure, $auditSuccess) { diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php index 42fc67c..e37e82b 100644 --- a/Acl/Domain/ObjectIdentity.php +++ b/Acl/Domain/ObjectIdentity.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Acl\Domain; +use Symfony\Component\Security\Core\Util\ClassUtils; use Symfony\Component\Security\Acl\Exception\InvalidDomainObjectException; use Symfony\Component\Security\Acl\Model\DomainObjectInterface; use Symfony\Component\Security\Acl\Model\ObjectIdentityInterface; @@ -30,7 +31,6 @@ final class ObjectIdentity implements ObjectIdentityInterface * * @param string $identifier * @param string $type - * @return void */ public function __construct($identifier, $type) { @@ -60,9 +60,9 @@ final class ObjectIdentity implements ObjectIdentityInterface try { if ($domainObject instanceof DomainObjectInterface) { - return new self($domainObject->getObjectIdentifier(), get_class($domainObject)); + return new self($domainObject->getObjectIdentifier(), ClassUtils::getRealClass($domainObject)); } elseif (method_exists($domainObject, 'getId')) { - return new self($domainObject->getId(), get_class($domainObject)); + return new self($domainObject->getId(), ClassUtils::getRealClass($domainObject)); } } catch (\InvalidArgumentException $invalid) { throw new InvalidDomainObjectException($invalid->getMessage(), 0, $invalid); diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php index 5fb8460..c34db2a 100644 --- a/Acl/Domain/PermissionGrantingStrategy.php +++ b/Acl/Domain/PermissionGrantingStrategy.php @@ -35,7 +35,6 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface * Sets the audit logger * * @param AuditLoggerInterface $auditLogger - * @return void */ public function setAuditLogger(AuditLoggerInterface $auditLogger) { diff --git a/Acl/Domain/RoleSecurityIdentity.php b/Acl/Domain/RoleSecurityIdentity.php index 51d3d0c..0d3d0d2 100644 --- a/Acl/Domain/RoleSecurityIdentity.php +++ b/Acl/Domain/RoleSecurityIdentity.php @@ -27,7 +27,6 @@ final class RoleSecurityIdentity implements SecurityIdentityInterface * Constructor * * @param mixed $role a Role instance, or its string representation - * @return void */ public function __construct($role) { diff --git a/Acl/Domain/SecurityIdentityRetrievalStrategy.php b/Acl/Domain/SecurityIdentityRetrievalStrategy.php index 67312b2..dbc0530 100644 --- a/Acl/Domain/SecurityIdentityRetrievalStrategy.php +++ b/Acl/Domain/SecurityIdentityRetrievalStrategy.php @@ -34,8 +34,6 @@ class SecurityIdentityRetrievalStrategy implements SecurityIdentityRetrievalStra * * @param RoleHierarchyInterface $roleHierarchy * @param AuthenticationTrustResolver $authenticationTrustResolver - * - * @return void */ public function __construct(RoleHierarchyInterface $roleHierarchy, AuthenticationTrustResolver $authenticationTrustResolver) { diff --git a/Acl/Domain/UserSecurityIdentity.php b/Acl/Domain/UserSecurityIdentity.php index e9ff0a2..040e43b 100644 --- a/Acl/Domain/UserSecurityIdentity.php +++ b/Acl/Domain/UserSecurityIdentity.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Acl\Domain; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Component\Security\Core\Util\ClassUtils; use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; /** @@ -52,7 +53,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface */ static public function fromAccount(UserInterface $user) { - return new self($user->getUsername(), get_class($user)); + return new self($user->getUsername(), ClassUtils::getRealClass($user)); } /** @@ -69,7 +70,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface return self::fromAccount($user); } - return new self((string) $user, is_object($user)? get_class($user) : get_class($token)); + return new self((string) $user, is_object($user) ? ClassUtils::getRealClass($user) : ClassUtils::getRealClass($token)); } /** diff --git a/Acl/Exception/NotAllAclsFoundException.php b/Acl/Exception/NotAllAclsFoundException.php index 8e7a08f..3c02495 100644 --- a/Acl/Exception/NotAllAclsFoundException.php +++ b/Acl/Exception/NotAllAclsFoundException.php @@ -28,7 +28,6 @@ class NotAllAclsFoundException extends AclNotFoundException * Sets the partial result * * @param \SplObjectStorage $result - * @return void */ public function setPartialResult(\SplObjectStorage $result) { diff --git a/Acl/Model/AclCacheInterface.php b/Acl/Model/AclCacheInterface.php index bc6c11f..dd515ce 100644 --- a/Acl/Model/AclCacheInterface.php +++ b/Acl/Model/AclCacheInterface.php @@ -22,7 +22,6 @@ interface AclCacheInterface * Removes an ACL from the cache * * @param string $primaryKey a serialized primary key - * @return void */ function evictFromCacheById($primaryKey); @@ -32,7 +31,6 @@ interface AclCacheInterface * The ACL which is returned, must reference the passed object identity. * * @param ObjectIdentityInterface $oid - * @return void */ function evictFromCacheByIdentity(ObjectIdentityInterface $oid); @@ -56,14 +54,11 @@ interface AclCacheInterface * Stores a new ACL in the cache * * @param AclInterface $acl - * @return void */ function putInCache(AclInterface $acl); /** * Removes all ACLs from the cache - * - * @return void */ function clearCache(); } diff --git a/Acl/Model/AuditLoggerInterface.php b/Acl/Model/AuditLoggerInterface.php index f4a83b3..7cab6f1 100644 --- a/Acl/Model/AuditLoggerInterface.php +++ b/Acl/Model/AuditLoggerInterface.php @@ -24,7 +24,6 @@ interface AuditLoggerInterface * * @param Boolean $granted * @param EntryInterface $ace - * @return void */ function logIfNeeded($granted, EntryInterface $ace); } diff --git a/Acl/Model/AuditableAclInterface.php b/Acl/Model/AuditableAclInterface.php index 8f473ff..5da593e 100644 --- a/Acl/Model/AuditableAclInterface.php +++ b/Acl/Model/AuditableAclInterface.php @@ -24,7 +24,6 @@ interface AuditableAclInterface extends MutableAclInterface * @param integer $index * @param Boolean $auditSuccess * @param Boolean $auditFailure - * @return void */ function updateClassAuditing($index, $auditSuccess, $auditFailure); @@ -35,9 +34,7 @@ interface AuditableAclInterface extends MutableAclInterface * @param string $field * @param Boolean $auditSuccess * @param Boolean $auditFailure - * @return void */ - function updateClassFieldAuditing($index, $field, $auditSuccess, $auditFailure); /** @@ -46,7 +43,6 @@ interface AuditableAclInterface extends MutableAclInterface * @param integer $index * @param Boolean $auditSuccess * @param Boolean $auditFailure - * @return void */ function updateObjectAuditing($index, $auditSuccess, $auditFailure); @@ -57,7 +53,6 @@ interface AuditableAclInterface extends MutableAclInterface * @param string $field * @param Boolean $auditSuccess * @param Boolean $auditFailure - * @return void */ function updateObjectFieldAuditing($index, $field, $auditSuccess, $auditFailure); } diff --git a/Acl/Model/MutableAclInterface.php b/Acl/Model/MutableAclInterface.php index b83c106..f84e817 100644 --- a/Acl/Model/MutableAclInterface.php +++ b/Acl/Model/MutableAclInterface.php @@ -25,7 +25,6 @@ interface MutableAclInterface extends AclInterface * Deletes a class-based ACE * * @param integer $index - * @return void */ function deleteClassAce($index); @@ -34,7 +33,6 @@ interface MutableAclInterface extends AclInterface * * @param integer $index * @param string $field - * @return void */ function deleteClassFieldAce($index, $field); @@ -42,7 +40,6 @@ interface MutableAclInterface extends AclInterface * Deletes an object-based ACE * * @param integer $index - * @return void */ function deleteObjectAce($index); @@ -51,7 +48,6 @@ interface MutableAclInterface extends AclInterface * * @param integer $index * @param string $field - * @return void */ function deleteObjectFieldAce($index, $field); @@ -70,7 +66,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param Boolean $granting * @param string $strategy - * @return void */ function insertClassAce(SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null); @@ -83,7 +78,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param Boolean $granting * @param string $strategy - * @return void */ function insertClassFieldAce($field, SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null); @@ -95,7 +89,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param Boolean $granting * @param string $strategy - * @return void */ function insertObjectAce(SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null); @@ -108,7 +101,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param Boolean $granting * @param string $strategy - * @return void */ function insertObjectFieldAce($field, SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null); @@ -116,17 +108,16 @@ interface MutableAclInterface extends AclInterface * Sets whether entries are inherited * * @param Boolean $boolean - * @return void */ function setEntriesInheriting($boolean); /** * Sets the parent ACL * - * @param AclInterface $acl + * @param AclInterface|null $acl * @return void */ - function setParentAcl(AclInterface $acl); + function setParentAcl(AclInterface $acl = null); /** * Updates a class-based ACE @@ -134,7 +125,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param integer $mask * @param string $strategy if null the strategy should not be changed - * @return void */ function updateClassAce($index, $mask, $strategy = null); @@ -145,7 +135,6 @@ interface MutableAclInterface extends AclInterface * @param string $field * @param integer $mask * @param string $strategy if null the strategy should not be changed - * @return void */ function updateClassFieldAce($index, $field, $mask, $strategy = null); @@ -155,7 +144,6 @@ interface MutableAclInterface extends AclInterface * @param integer $index * @param integer $mask * @param string $strategy if null the strategy should not be changed - * @return void */ function updateObjectAce($index, $mask, $strategy = null); @@ -166,7 +154,6 @@ interface MutableAclInterface extends AclInterface * @param string $field * @param integer $mask * @param string $strategy if null the strategy should not be changed - * @return void */ function updateObjectFieldAce($index, $field, $mask, $strategy = null); } diff --git a/Acl/Model/MutableAclProviderInterface.php b/Acl/Model/MutableAclProviderInterface.php index 4671816..04cf237 100644 --- a/Acl/Model/MutableAclProviderInterface.php +++ b/Acl/Model/MutableAclProviderInterface.php @@ -35,7 +35,6 @@ interface MutableAclProviderInterface extends AclProviderInterface * want child ACLs to be deleted, you will have to set their parent ACL to null. * * @param ObjectIdentityInterface $oid - * @return void */ function deleteAcl(ObjectIdentityInterface $oid); @@ -46,7 +45,6 @@ interface MutableAclProviderInterface extends AclProviderInterface * Changes to parent ACLs are not persisted. * * @param MutableAclInterface $acl - * @return void */ function updateAcl(MutableAclInterface $acl); } diff --git a/Acl/Model/SecurityIdentityInterface.php b/Acl/Model/SecurityIdentityInterface.php index 1833630..5bf6189 100644 --- a/Acl/Model/SecurityIdentityInterface.php +++ b/Acl/Model/SecurityIdentityInterface.php @@ -25,7 +25,6 @@ interface SecurityIdentityInterface * not rely on referential equality. * * @param SecurityIdentityInterface $identity - * @return void */ function equals(SecurityIdentityInterface $identity); } diff --git a/Acl/Permission/MaskBuilder.php b/Acl/Permission/MaskBuilder.php index b17233f..6921558 100644 --- a/Acl/Permission/MaskBuilder.php +++ b/Acl/Permission/MaskBuilder.php @@ -73,7 +73,6 @@ class MaskBuilder * Constructor * * @param integer $mask optional; defaults to 0 - * @return void */ public function __construct($mask = 0) { @@ -88,7 +87,7 @@ class MaskBuilder * Adds a mask to the permission * * @param mixed $mask - * @return PermissionBuilder + * @return MaskBuilder */ public function add($mask) { @@ -141,7 +140,7 @@ class MaskBuilder * Removes a mask from the permission * * @param mixed $mask - * @return PermissionBuilder + * @return MaskBuilder */ public function remove($mask) { @@ -159,7 +158,7 @@ class MaskBuilder /** * Resets the PermissionBuilder * - * @return PermissionBuilder + * @return MaskBuilder */ public function reset() { diff --git a/Acl/Resources/bin/generateSql.php b/Acl/Resources/bin/generateSql.php index dc247d4..0f9b4c1 100644 --- a/Acl/Resources/bin/generateSql.php +++ b/Acl/Resources/bin/generateSql.php @@ -1,12 +1,12 @@ <?php /* - * This file is part of the Symfony framework. + * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ require_once __DIR__.'/../../../../ClassLoader/UniversalClassLoader.php'; diff --git a/Acl/Resources/schema/db2.sql b/Acl/Resources/schema/db2.sql index de30c3b..2d10c14 100644 --- a/Acl/Resources/schema/db2.sql +++ b/Acl/Resources/schema/db2.sql @@ -30,14 +30,14 @@ CREATE INDEX IDX_46C8B8063D9AB4A6 ON acl_entries (object_identity_id) CREATE INDEX IDX_46C8B806DF9183C9 ON acl_entries (security_identity_id) -ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE RESTRICT ON DELETE RESTRICT +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities(id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file diff --git a/Acl/Resources/schema/drizzle.sql b/Acl/Resources/schema/drizzle.sql new file mode 100644 index 0000000..378f114 --- /dev/null +++ b/Acl/Resources/schema/drizzle.sql @@ -0,0 +1,21 @@ +CREATE TABLE acl_classes (id INT AUTO_INCREMENT NOT NULL, class_type VARCHAR(200) NOT NULL, PRIMARY KEY(id), UNIQUE INDEX UNIQ_69DD750638A36066 (class_type)) + +CREATE TABLE acl_security_identities (id INT AUTO_INCREMENT NOT NULL, identifier VARCHAR(200) NOT NULL, username BOOLEAN NOT NULL, PRIMARY KEY(id), UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 (identifier, username)) + +CREATE TABLE acl_object_identities (id INT AUTO_INCREMENT NOT NULL, parent_object_identity_id INT DEFAULT NULL, class_id INT NOT NULL, object_identifier VARCHAR(100) NOT NULL, entries_inheriting BOOLEAN NOT NULL, PRIMARY KEY(id), UNIQUE INDEX UNIQ_9407E5494B12AD6EA000B10 (object_identifier, class_id), INDEX IDX_9407E54977FA751A (parent_object_identity_id)) + +CREATE TABLE acl_object_identity_ancestors (object_identity_id INT NOT NULL, ancestor_id INT NOT NULL, PRIMARY KEY(object_identity_id, ancestor_id), INDEX IDX_825DE2993D9AB4A6 (object_identity_id), INDEX IDX_825DE299C671CEA1 (ancestor_id)) + +CREATE TABLE acl_entries (id INT AUTO_INCREMENT NOT NULL, class_id INT NOT NULL, object_identity_id INT DEFAULT NULL, security_identity_id INT NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order INT NOT NULL, mask INT NOT NULL, granting BOOLEAN NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success BOOLEAN NOT NULL, audit_failure BOOLEAN NOT NULL, PRIMARY KEY(id), UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 (class_id, object_identity_id, field_name, ace_order), INDEX IDX_46C8B806EA000B103D9AB4A6DF9183C9 (class_id, object_identity_id, security_identity_id), INDEX IDX_46C8B806EA000B10 (class_id), INDEX IDX_46C8B8063D9AB4A6 (object_identity_id), INDEX IDX_46C8B806DF9183C9 (security_identity_id)) + +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) + +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE + +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE + +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON UPDATE CASCADE ON DELETE CASCADE + +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE + +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file diff --git a/Acl/Resources/schema/mssql.sql b/Acl/Resources/schema/mssql.sql index 86bffe0..1b4733c 100644 --- a/Acl/Resources/schema/mssql.sql +++ b/Acl/Resources/schema/mssql.sql @@ -1,24 +1,24 @@ -CREATE TABLE acl_classes (id INT IDENTITY NOT NULL, class_type NVARCHAR(200) NOT NULL, PRIMARY KEY(id)) +CREATE TABLE acl_classes (id INT UNSIGNED IDENTITY NOT NULL, class_type NVARCHAR(200) NOT NULL, PRIMARY KEY (id)) CREATE UNIQUE INDEX UNIQ_69DD750638A36066 ON acl_classes (class_type) WHERE class_type IS NOT NULL -CREATE TABLE acl_security_identities (id INT IDENTITY NOT NULL, identifier NVARCHAR(200) NOT NULL, username BIT NOT NULL, PRIMARY KEY(id)) +CREATE TABLE acl_security_identities (id INT UNSIGNED IDENTITY NOT NULL, identifier NVARCHAR(200) NOT NULL, username BIT NOT NULL, PRIMARY KEY (id)) CREATE UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 ON acl_security_identities (identifier, username) WHERE identifier IS NOT NULL AND username IS NOT NULL -CREATE TABLE acl_object_identities (id INT IDENTITY NOT NULL, parent_object_identity_id INT DEFAULT NULL, class_id INT NOT NULL, object_identifier NVARCHAR(100) NOT NULL, entries_inheriting BIT NOT NULL, PRIMARY KEY(id)) +CREATE TABLE acl_object_identities (id INT UNSIGNED IDENTITY NOT NULL, parent_object_identity_id INT UNSIGNED DEFAULT NULL, class_id INT UNSIGNED NOT NULL, object_identifier NVARCHAR(100) NOT NULL, entries_inheriting BIT NOT NULL, PRIMARY KEY (id)) CREATE UNIQUE INDEX UNIQ_9407E5494B12AD6EA000B10 ON acl_object_identities (object_identifier, class_id) WHERE object_identifier IS NOT NULL AND class_id IS NOT NULL CREATE INDEX IDX_9407E54977FA751A ON acl_object_identities (parent_object_identity_id) -CREATE TABLE acl_object_identity_ancestors (object_identity_id INT NOT NULL, ancestor_id INT NOT NULL, PRIMARY KEY(object_identity_id, ancestor_id)) +CREATE TABLE acl_object_identity_ancestors (object_identity_id INT UNSIGNED NOT NULL, ancestor_id INT UNSIGNED NOT NULL, PRIMARY KEY (object_identity_id, ancestor_id)) CREATE INDEX IDX_825DE2993D9AB4A6 ON acl_object_identity_ancestors (object_identity_id) CREATE INDEX IDX_825DE299C671CEA1 ON acl_object_identity_ancestors (ancestor_id) -CREATE TABLE acl_entries (id INT IDENTITY NOT NULL, class_id INT NOT NULL, object_identity_id INT DEFAULT NULL, security_identity_id INT NOT NULL, field_name NVARCHAR(50) DEFAULT NULL, ace_order SMALLINT NOT NULL, mask INT NOT NULL, granting BIT NOT NULL, granting_strategy NVARCHAR(30) NOT NULL, audit_success BIT NOT NULL, audit_failure BIT NOT NULL, PRIMARY KEY(id)) +CREATE TABLE acl_entries (id INT UNSIGNED IDENTITY NOT NULL, class_id INT UNSIGNED NOT NULL, object_identity_id INT UNSIGNED DEFAULT NULL, security_identity_id INT UNSIGNED NOT NULL, field_name NVARCHAR(50) DEFAULT NULL, ace_order SMALLINT UNSIGNED NOT NULL, mask INT NOT NULL, granting BIT NOT NULL, granting_strategy NVARCHAR(30) NOT NULL, audit_success BIT NOT NULL, audit_failure BIT NOT NULL, PRIMARY KEY (id)) CREATE UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 ON acl_entries (class_id, object_identity_id, field_name, ace_order) WHERE class_id IS NOT NULL AND object_identity_id IS NOT NULL AND field_name IS NOT NULL AND ace_order IS NOT NULL @@ -30,14 +30,14 @@ CREATE INDEX IDX_46C8B8063D9AB4A6 ON acl_entries (object_identity_id) CREATE INDEX IDX_46C8B806DF9183C9 ON acl_entries (security_identity_id) -ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE RESTRICT ON DELETE RESTRICT +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities(id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file diff --git a/Acl/Resources/schema/mysql.sql b/Acl/Resources/schema/mysql.sql index 0d2d50f..db01e95 100644 --- a/Acl/Resources/schema/mysql.sql +++ b/Acl/Resources/schema/mysql.sql @@ -1,21 +1,21 @@ -CREATE TABLE acl_classes (id INT AUTO_INCREMENT NOT NULL, class_type VARCHAR(200) NOT NULL, UNIQUE INDEX UNIQ_69DD750638A36066 (class_type), PRIMARY KEY(id)) ENGINE = InnoDB +CREATE TABLE acl_classes (id INT UNSIGNED AUTO_INCREMENT NOT NULL, class_type VARCHAR(200) NOT NULL, UNIQUE INDEX UNIQ_69DD750638A36066 (class_type), PRIMARY KEY(id)) ENGINE = InnoDB -CREATE TABLE acl_security_identities (id INT AUTO_INCREMENT NOT NULL, identifier VARCHAR(200) NOT NULL, username TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 (identifier, username), PRIMARY KEY(id)) ENGINE = InnoDB +CREATE TABLE acl_security_identities (id INT UNSIGNED AUTO_INCREMENT NOT NULL, identifier VARCHAR(200) NOT NULL, username TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 (identifier, username), PRIMARY KEY(id)) ENGINE = InnoDB -CREATE TABLE acl_object_identities (id INT AUTO_INCREMENT NOT NULL, parent_object_identity_id INT DEFAULT NULL, class_id INT NOT NULL, object_identifier VARCHAR(100) NOT NULL, entries_inheriting TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_9407E5494B12AD6EA000B10 (object_identifier, class_id), INDEX IDX_9407E54977FA751A (parent_object_identity_id), PRIMARY KEY(id)) ENGINE = InnoDB +CREATE TABLE acl_object_identities (id INT UNSIGNED AUTO_INCREMENT NOT NULL, parent_object_identity_id INT UNSIGNED DEFAULT NULL, class_id INT UNSIGNED NOT NULL, object_identifier VARCHAR(100) NOT NULL, entries_inheriting TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_9407E5494B12AD6EA000B10 (object_identifier, class_id), INDEX IDX_9407E54977FA751A (parent_object_identity_id), PRIMARY KEY(id)) ENGINE = InnoDB -CREATE TABLE acl_object_identity_ancestors (object_identity_id INT NOT NULL, ancestor_id INT NOT NULL, INDEX IDX_825DE2993D9AB4A6 (object_identity_id), INDEX IDX_825DE299C671CEA1 (ancestor_id), PRIMARY KEY(object_identity_id, ancestor_id)) ENGINE = InnoDB +CREATE TABLE acl_object_identity_ancestors (object_identity_id INT UNSIGNED NOT NULL, ancestor_id INT UNSIGNED NOT NULL, INDEX IDX_825DE2993D9AB4A6 (object_identity_id), INDEX IDX_825DE299C671CEA1 (ancestor_id), PRIMARY KEY(object_identity_id, ancestor_id)) ENGINE = InnoDB -CREATE TABLE acl_entries (id INT AUTO_INCREMENT NOT NULL, class_id INT NOT NULL, object_identity_id INT DEFAULT NULL, security_identity_id INT NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order SMALLINT NOT NULL, mask INT NOT NULL, granting TINYINT(1) NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success TINYINT(1) NOT NULL, audit_failure TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 (class_id, object_identity_id, field_name, ace_order), INDEX IDX_46C8B806EA000B103D9AB4A6DF9183C9 (class_id, object_identity_id, security_identity_id), INDEX IDX_46C8B806EA000B10 (class_id), INDEX IDX_46C8B8063D9AB4A6 (object_identity_id), INDEX IDX_46C8B806DF9183C9 (security_identity_id), PRIMARY KEY(id)) ENGINE = InnoDB +CREATE TABLE acl_entries (id INT UNSIGNED AUTO_INCREMENT NOT NULL, class_id INT UNSIGNED NOT NULL, object_identity_id INT UNSIGNED DEFAULT NULL, security_identity_id INT UNSIGNED NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order SMALLINT UNSIGNED NOT NULL, mask INT NOT NULL, granting TINYINT(1) NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success TINYINT(1) NOT NULL, audit_failure TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 (class_id, object_identity_id, field_name, ace_order), INDEX IDX_46C8B806EA000B103D9AB4A6DF9183C9 (class_id, object_identity_id, security_identity_id), INDEX IDX_46C8B806EA000B10 (class_id), INDEX IDX_46C8B8063D9AB4A6 (object_identity_id), INDEX IDX_46C8B806DF9183C9 (security_identity_id), PRIMARY KEY(id)) ENGINE = InnoDB -ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE RESTRICT ON DELETE RESTRICT +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities(id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON UPDATE CASCADE ON DELETE CASCADE
\ No newline at end of file diff --git a/Acl/Resources/schema/oracle.sql b/Acl/Resources/schema/oracle.sql index 3c4afcc..9896cf0 100644 --- a/Acl/Resources/schema/oracle.sql +++ b/Acl/Resources/schema/oracle.sql @@ -162,14 +162,14 @@ CREATE INDEX IDX_46C8B8063D9AB4A6 ON acl_entries (object_identity_id) CREATE INDEX IDX_46C8B806DF9183C9 ON acl_entries (security_identity_id) -ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities(id) ON DELETE RESTRICT +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON DELETE CASCADE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities(id) ON DELETE CASCADE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes(id) ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON DELETE CASCADE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON DELETE CASCADE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities(id) ON DELETE CASCADE
\ No newline at end of file +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON DELETE CASCADE
\ No newline at end of file diff --git a/Acl/Resources/schema/postgresql.sql b/Acl/Resources/schema/postgresql.sql index 0d59c46..05ca439 100644 --- a/Acl/Resources/schema/postgresql.sql +++ b/Acl/Resources/schema/postgresql.sql @@ -30,14 +30,14 @@ CREATE INDEX IDX_46C8B8063D9AB4A6 ON acl_entries (object_identity_id) CREATE INDEX IDX_46C8B806DF9183C9 ON acl_entries (security_identity_id) -ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE RESTRICT ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id) NOT DEFERRABLE INITIALLY IMMEDIATE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE -ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806EA000B10 FOREIGN KEY (class_id) REFERENCES acl_classes (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B8063D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE -ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE
\ No newline at end of file +ALTER TABLE acl_entries ADD CONSTRAINT FK_46C8B806DF9183C9 FOREIGN KEY (security_identity_id) REFERENCES acl_security_identities (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE
\ No newline at end of file diff --git a/Acl/Resources/schema/sqlite.sql b/Acl/Resources/schema/sqlite.sql index 784df73..21c9f67 100644 --- a/Acl/Resources/schema/sqlite.sql +++ b/Acl/Resources/schema/sqlite.sql @@ -1,12 +1,12 @@ -CREATE TABLE acl_classes (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, class_type VARCHAR(200) NOT NULL) +CREATE TABLE acl_classes (id INTEGER NOT NULL, class_type VARCHAR(200) NOT NULL, PRIMARY KEY("id")) CREATE UNIQUE INDEX UNIQ_69DD750638A36066 ON acl_classes (class_type) -CREATE TABLE acl_security_identities (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, identifier VARCHAR(200) NOT NULL, username BOOLEAN NOT NULL) +CREATE TABLE acl_security_identities (id INTEGER NOT NULL, identifier VARCHAR(200) NOT NULL, username BOOLEAN NOT NULL, PRIMARY KEY("id")) CREATE UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 ON acl_security_identities (identifier, username) -CREATE TABLE acl_object_identities (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, parent_object_identity_id INTEGER DEFAULT NULL, class_id INTEGER NOT NULL, object_identifier VARCHAR(100) NOT NULL, entries_inheriting BOOLEAN NOT NULL) +CREATE TABLE acl_object_identities (id INTEGER NOT NULL, parent_object_identity_id INTEGER DEFAULT NULL, class_id INTEGER NOT NULL, object_identifier VARCHAR(100) NOT NULL, entries_inheriting BOOLEAN NOT NULL, PRIMARY KEY("id")) CREATE UNIQUE INDEX UNIQ_9407E5494B12AD6EA000B10 ON acl_object_identities (object_identifier, class_id) @@ -18,7 +18,7 @@ CREATE INDEX IDX_825DE2993D9AB4A6 ON acl_object_identity_ancestors (object_ident CREATE INDEX IDX_825DE299C671CEA1 ON acl_object_identity_ancestors (ancestor_id) -CREATE TABLE acl_entries (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, class_id INTEGER NOT NULL, object_identity_id INTEGER DEFAULT NULL, security_identity_id INTEGER NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order INTEGER NOT NULL, mask INTEGER NOT NULL, granting BOOLEAN NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success BOOLEAN NOT NULL, audit_failure BOOLEAN NOT NULL) +CREATE TABLE acl_entries (id INTEGER NOT NULL, class_id INTEGER NOT NULL, object_identity_id INTEGER DEFAULT NULL, security_identity_id INTEGER NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order INTEGER NOT NULL, mask INTEGER NOT NULL, granting BOOLEAN NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success BOOLEAN NOT NULL, audit_failure BOOLEAN NOT NULL, PRIMARY KEY("id")) CREATE UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 ON acl_entries (class_id, object_identity_id, field_name, ace_order) |