Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


$identifier cannot be empty, when creating class scope #13

mailaneel opened this Issue · 6 comments

3 participants

$aclManager = $this->get('problematic.acl_manager');
$aclManager->setClassPermission('Entity\Subscriber', MaskBuilder::MASK_OWNER, 'ROLE_CLIENT');

internally setClassPermission is using $oid = ObjectIdentity::fromDomainObject($domainObject); instead i think we should check the type and then get the oid because for class type we should use new ObjectIdentity($identifier, $type)


This is fix that i have added

 $oid = ($type == 'object')? ObjectIdentity::fromDomainObject($domainObject) : new ObjectIdentity('class',$domainObject);

Thanks for the help! If you can submit a pull request, I'll look it over and get it merged.


Implemented this instead, ignore my pull


namespace WSL\BaseBundle\Entity;

use Doctrine\ORM\Mapping as ORM,

 * WSL\BaseBundle\Entity\DomainObject
 * @MappedSuperclass
class DomainObject implements DomainObjectInterface

    public function getObjectIdentifier()
        $identifier = $this->getId();
        return (!empty($identifier)) ? $identifier : 'class';


I still think there's value in being able to handle class-level ACLs without requiring extra code. I'm going to leave this open for now while I think it over.



@mailaneel mailaneel referenced this issue from a commit in mailaneel/ProblematicAclManagerBundle
@mailaneel mailaneel Reverted added fix for #13 1f0b9b4
@Problematic Problematic closed this issue from a commit
@mailaneel mailaneel closes #13 c1416b0

I think the first fix is the right one, since our entity might extend from another base class and thus can't use the second @mailaneel fix. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.