I am working on a Symfony project where I need to manage roles. I want to use ACATA sonatas but cannot make it work.
A user with ROLE_CONTACT should be able to list, create and edit a user, but he can only list and add users.
I have completed the documentation here .
Here is my code.
security.yml
role_hierarchy:
ROLE_TRADUCTEUR: [ROLE_USER]
ROLE_CONTACT:
- ROLE_SONATA_ADMIN
- ROLE_SONATA_ADMIN_USER_STAFF
- ...
acl:
connection: default
services.yml
parameters:
# parameter_name: value
security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
sonata.admin.security.mask.builder.class: Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder
sonata_admin.yml (included in config.yml)
sonata_admin:
templates:
layout: SonataAdminBundle::extend_layout.html.twig
security:
handler: sonata.admin.security.handler.acl
information:
GUEST: [VIEW, LIST]
STAFF: [EDIT, LIST, CREATE]
EDITOR: [OPERATOR, EXPORT]
ADMIN: [MASTER]
admin_permissions: [CREATE, LIST, DELETE, UNDELETE, EXPORT, OPERATOR, MASTER]
object_permissions: [VIEW, EDIT, DELETE, UNDELETE, OPERATOR, MASTER, OWNER]
Could you help me? Thanks you
source
share