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

EDITOR role not working #29

Open
lukepass opened this issue Jan 5, 2018 · 1 comment
Open

EDITOR role not working #29

lukepass opened this issue Jan 5, 2018 · 1 comment

Comments

@lukepass
Copy link

lukepass commented Jan 5, 2018

Hello, I am trying to use this bundle but it just hides ALL the items from the list except the items created by the owner, what am I doing wrong?

config.yml

sonata_admin:
    security:
        handler: sonata.admin.security.handler.acl

        role_admin: ROLE_ADMIN
        role_super_admin: ROLE_SUPER_ADMIN

        # acl security information
        information:
            GUEST:    [VIEW, LIST]
            STAFF:    [EDIT, LIST, CREATE]
            EDITOR:   [OPERATOR, EXPORT]
            ADMIN:    [MASTER]

        # permissions not related to an object instance and also to be available when objects do not exist
        # the DELETE admin permission means the user is allowed to batch delete objects
        admin_permissions: [CREATE, LIST, DELETE, UNDELETE, EXPORT, OPERATOR, MASTER]

        # permission related to the objects
        object_permissions: [VIEW, EDIT, DELETE, UNDELETE, OPERATOR, MASTER, OWNER]

security.yml

security:
    role_hierarchy:
        ROLE_ADMIN:
            - ROLE_USER
            - ROLE_SONATA_ADMIN
            - ROLE_APP_ADMIN_PRODUCT_FAMILY_EDITOR
            - ROLE_APP_ADMIN_PRODUCT_EDITOR
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
        #SONATA:
            #- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT  # if you are using acl then this line must be commented

    # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
    providers:
        fos_userbundle:
            id: fos_user.user_provider.username

When I log in as a ROLE_ADMIN I see the product family list empty except for the items I created myself.

Thanks.

@lukepass
Copy link
Author

lukepass commented Jan 8, 2018

I noticed that if I give the user the ROLE_APP_ADMIN_PRODUCT_EDITOR directly instead of the ROLE_ADMIN, the filters are working correctly. Maybe a problem with role hierarchy?

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

1 participant