php - Is ROLE_ADMIN needed on this setup? -
i need setting role hierarchy configuration under symfony2 project. have 2 areas frontend
users role_chat
should able login , backend
role_admin
allowed. have 2 more roles: role_executive
, role_loader1
can't access areas under backend table below shows:
item role_admin role_chat role_executive role_loader1 user x category x command x x x alias x x report x x x
i having problems because don't know how setup role_hierarchy
under security.yml
allow permissions shown above. have right now:
security: encoders: fos\userbundle\model\userinterface: bcrypt
role_hierarchy: role_chat: role_user role_loader1: [role_user, role_admin] role_loader2: [role_user, role_admin] role_executive: [role_user, role_admin] role_admin: [role_user, role_chat, rol_executive, role_loader1, role_loader2] role_super_admin: [role_admin, role_allowed_to_switch] providers: fos_userbundle: id: fos_user.user_provider.username_email firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ anonymous: ~ provider: fos_userbundle form_login: csrf_token_generator: security.csrf.token_manager always_use_default_target_path: true default_target_path: root use_referer: false remember_me: true logout: path: fos_user_security_logout target: root remember_me: secret: '%secret%' lifetime: 604800 # 1 week in seconds path: / access_control: - { path: ^/login$, role: is_authenticated_anonymously } - { path: ^/resetting, role: is_authenticated_anonymously } - { path: ^/chat/, role: role_chat } - { path: ^/admin/, role: role_admin }
my doubt here is: in order access backend area role_chat
,role_executive
,role_loader1
needs role_admin
also? there other way setup this? don't know if can fixed using access_control
or goes beyond , uses acl wich makes more complex, advices around setup? ideas? how that?
Comments
Post a Comment