Oumayma Ben Ahmed
Oumayma Ben Ahmed

Reputation: 37

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

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

Any idea?

Upvotes: 0

Views: 188

Answers (1)

Guillaume Harari
Guillaume Harari

Reputation: 505

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

Upvotes: 1

Related Questions