Advertisement
Guest User

security.yaml

a guest
Dec 7th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. security:
  2. always_authenticate_before_granting: true
  3.  
  4. encoders:
  5. App\Entity\User:
  6. algorithm: auto
  7.  
  8. # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
  9. providers:
  10. in_memory: { memory: ~ }
  11. # used to reload user from session & other features (e.g. switch_user)
  12. in_database:
  13. entity:
  14. class: App\Entity\User
  15. property: email
  16. firewalls:
  17. dev:
  18. pattern: ^/(_(profiler|wdt)|css|images|js)/
  19. security: false
  20. main:
  21. anonymous: true
  22.  
  23. provider: in_database
  24.  
  25. form_login:
  26. login_path: account_login
  27. check_path: account_login
  28. default_target_path: home
  29.  
  30. logout:
  31. path: account_logout
  32. target: account_login
  33. # activate different ways to authenticate
  34. # https://symfony.com/doc/current/security.html#firewalls-authentication
  35. # https://symfony.com/doc/current/security/impersonating_user.html
  36. # switch_user: true
  37.  
  38. # Easy way to control access for large sections of your site
  39. # Note: Only the *first* access control that matches will be used
  40. access_control:
  41. - {path : /login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  42. - {path : /register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  43. - { path: /requete, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  44. - { path: ^/reset, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  45. - { path: ^/, roles: ROLE_USER }
  46. - { path: ^/chef-service, roles: ROLE_CHEF_SERVICE }
  47. - { path: ^/validateur, roles: [ROLE_VALIDATEUR, ROLE_SUPPLEANT] }
  48. - { path: ^/super-validateur, roles: ROLE_SUPER_VALIDATEUR }
  49. - { path: ^/rh, roles: ROLE_RH }
  50. - { path: ^/admin, roles: ROLE_ADMIN }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement