here is my security.yml file
security:
access_denied_url: home
encoders:
Coupon\MainBundle\Entity\User:
algorithm: sha512
iterations: 1
encode_as_base64: true
role_hierarchy:
ROLE_ADMIN: [ROLE_USER]
ROLE_SUPER_ADMIN: [ROLE_ADMIN]
providers:
main:
entity: { class: CouponMainBundle:User }
firewalls:
secured_area:
pattern: ^/
form_login:
check_path: _auth_check
always_use_default_target_path: true
default_target_path: /dut
login_path: /
logout:
path: action_logout
target: action_login
anonymous: ~
access_control:
- { path: ^/admin.*, role: ROLE_ADMIN }
but when try to go to /admin
with user who has ROLE_ADMIN
(var_dump for getRoles returns array(2) { [0]=> string(10) "ROLE_ADMIN" [1]=> string(9) "ROLE_USER" }
), it redirects me to home page, can you help me ? where is my fault ?