How can i add a role in security.yml on symfony2

183 Views Asked by At

I want to add a role to manage the display of submenu in dashboard on sonataAdmiBundle.

Any idea?

1

There are 1 best solutions below

0
Guillaume Harari On

you just have to define roles :

# config/packages/security.yaml
security:
    providers:
        in_memory:
            memory:
                users:
                    ryan:
                        password: ryanpass
                        roles: 'ROLE_USER'
                    admin:
                        password: kitten
                        roles: 'ROLE_ADMIN'
    # ...

http://symfony.com/doc/current/security.html