security.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. jms_security_extra:
  2. secure_all_services: false
  3. expressions: true
  4. security:
  5. encoders:
  6. FOS\UserBundle\Model\UserInterface:
  7. algorithm: sha512
  8. encode_as_base64: false
  9. iterations: 1
  10. providers:
  11. packagist:
  12. id: packagist.user_provider
  13. firewalls:
  14. main:
  15. pattern: .*
  16. form_login:
  17. provider: packagist
  18. login_path: /login
  19. use_forward: false
  20. check_path: /login_check
  21. failure_path: null
  22. remember_me:
  23. key: %remember_me.secret%
  24. user_providers: packagist
  25. name: pauth
  26. remember_me_parameter: _remember_me
  27. lifetime: 31104000 # 1y
  28. logout: true
  29. anonymous: true
  30. access_control:
  31. # The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
  32. - { path: ^/_wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  33. - { path: ^/_profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  34. # AsseticBundle paths used when using the controller for assets
  35. - { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  36. - { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  37. # URL of FOSUserBundle which need to be available to anonymous users
  38. - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  39. - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
  40. - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
  41. # Secured part of the site
  42. # This config requires being logged for the whole site and having the admin role for the admin part.
  43. # Change these rules to adapt them to your needs
  44. - { path: ^/packages/submit$, role: ROLE_USER }
  45. - { path: ^/admin/, role: ROLE_ADMIN }
  46. role_hierarchy:
  47. ROLE_UPDATE_PACKAGES: ~
  48. ROLE_DELETE_PACKAGES: ~
  49. ROLE_ADMIN: [ ROLE_USER, ROLE_UPDATE_PACKAGES, ROLE_DELETE_PACKAGES ]
  50. ROLE_SUPERADMIN: [ ROLE_ADMIN ]