I'm using fosuserbundle for registration and login (authentication). I want to assign roles at registration time (using check boxes).
These three will be in form of Check boxes ROLE_ADMIN, ROLE_USER, ROLE_SUPPER_ADMIN.
I created a User entity that extends baseUser. I have RegisterType extending BaseType.
I want to use fosuserbundle's role value, how do I link fosuserbundle's role with checkbox?
My security.yml is given below
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: security.csrf.token_manager
logout:
path: /logout
target: /login
anonymous: true
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: ROLE_USER }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/Services/, role: ROLE_USER }
What must I do now to achieve what I want?