security.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. security:
  2. providers:
  3. fos_userbundle:
  4. id: fos_user.user_manager
  5. firewalls:
  6. main:
  7. pattern: .*
  8. form_login:
  9. provider: fos_userbundle
  10. login_path: /login
  11. use_forward: false
  12. check_path: /login_check
  13. failure_path: null
  14. logout: true
  15. anonymous: true
  16. access_control:
  17. # The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
  18. - { path: ^/_wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  19. - { path: ^/_profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  20. # AsseticBundle paths used when using the controller for assets
  21. - { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  22. - { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  23. # URL of FOSUserBundle which need to be available to anonymous users
  24. - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  25. - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
  26. - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
  27. # Secured part of the site
  28. # This config requires being logged for the whole site and having the admin role for the admin part.
  29. # Change these rules to adapt them to your needs
  30. - { path: ^/packages/submit$, role: ROLE_USER }
  31. - { path: ^/admin/, role: ROLE_ADMIN }
  32. role_hierarchy:
  33. ROLE_ADMIN: ROLE_USER
  34. ROLE_SUPERADMIN: ROLE_ADMIN