Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class permission #17

Open
unusorin opened this issue Jun 14, 2014 · 2 comments
Open

Class permission #17

unusorin opened this issue Jun 14, 2014 · 2 comments
Assignees

Comments

@unusorin
Copy link

Hi,
I'm trying to set up this acl manger with doctrine ODM on Symfony 2.5. Everything seems to work but I've noticed that the class permissions are not working. Basically, I've annotated my document like

     @Acl\DomainObject({
         @Acl\ClassPermission({ "ROLE_ADMIN" = MaskBuilder::MASK_IDDQD })
       })

, but when I check permissions with isGranted using a normal user, it allows me to create a new document. Do you have any ideas about this issue ?

Thanks.

@sheeep
Copy link
Contributor

sheeep commented Jun 20, 2014

IIRC this is the way the current granting process works. Have you tried to explicitly define the permission for ROLE_USER?

@Acl\DomainObject({
    @Acl\ClassPermission({ "ROLE_ADMIN" = MaskBuilder::MASK_IDDQD })
    @Acl\ClassPermission({ "ROLE_USER" = MaskBuilder::MASK_VIEW })
})

@sheeep sheeep self-assigned this Jun 20, 2014
@GreGosPhaTos
Copy link

I Have a similar issue :

security:
      acl:
        connection: default
        voter:
          allow_if_object_identity_unavailable: false

And when I do

$aclManager->setClassPermission('My\\Class\\Name', MaskBuilder::MASK_VIEW, $user);

// always returns false 
$aclManager->isGranted('VIEW', 'My\\Class\\Name')

isGranted returns always false ... Did I miss something ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants