allow unsetting parentAcl on MutableAclInterface
This commit is contained in:
parent
916597eb29
commit
dbd3a1bcc0
@ -311,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.');
|
||||
}
|
||||
|
||||
|
@ -114,9 +114,10 @@ interface MutableAclInterface extends AclInterface
|
||||
/**
|
||||
* 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
|
||||
|
@ -250,6 +250,9 @@ class AclTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($acl->getParentAcl());
|
||||
$acl->setParentAcl($parentAcl);
|
||||
$this->assertSame($parentAcl, $acl->getParentAcl());
|
||||
|
||||
$acl->setParentAcl(null);
|
||||
$this->assertNull($acl->getParentAcl());
|
||||
}
|
||||
|
||||
public function testSetIsEntriesInheriting()
|
||||
|
Reference in New Issue
Block a user