security.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # To get started with security, check out the documentation:
  2. # https://symfony.com/doc/current/security.html
  3. security:
  4. encoders:
  5. AppBundle\Entity\User: sha512
  6. role_hierarchy:
  7. ROLE_ADMIN: [ROLE_USER, ROLE_MODERATEUR]
  8. ROLE_SUPER_ADMIN: (ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  9. # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
  10. providers:
  11. main:
  12. entity:
  13. class: AppBundle\Entity\User
  14. property: username
  15. firewalls:
  16. # disables authentication for assets and the profiler, adapt it according to your needs
  17. dev:
  18. pattern: ^/(_(profiler|wdt)|css|images|js)/
  19. security: false
  20. main_login:
  21. pattern: ^/login$
  22. anonymous: true
  23. logout_on_user_change: true
  24. main:
  25. anonymous: true
  26. pattern: ^/
  27. logout_on_user_change: true
  28. provider: main
  29. form_login:
  30. login_path: login
  31. check_path: login_check
  32. logout:
  33. path: logout
  34. target: login
  35. remember_me:
  36. secret: "%secret%"
  37. # activate different ways to authenticate
  38. # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
  39. #http_basic: ~
  40. # https://symfony.com/doc/current/security/form_login_setup.html
  41. #form_login: ~
  42. access_control:
  43. - { path: ^/aaadmin, roles: ROLE_ADMIN }