security.yml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. security:
  2. encoders:
  3. FOS\UserBundle\Model\UserInterface:
  4. id: chamilo_user.security.encoder
  5. role_hierarchy:
  6. ROLE_SONATA_ADMIN: ROLE_USER
  7. ROLE_ADMIN:
  8. - ROLE_SONATA_ADMIN
  9. - ROLE_QUESTION_MANAGER
  10. - ROLE_SESSION_MANAGER
  11. - ROLE_TEACHER
  12. - ROLE_DIRECTOR
  13. - ROLE_JURY_PRESIDENT
  14. - ROLE_CURRENT_COURSE_TEACHER
  15. ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  16. ROLE_GLOBAL_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  17. ROLE_RRHH: [ROLE_TEACHER]
  18. ROLE_TEACHER: [ROLE_STUDENT]
  19. ROLE_QUESTION_MANAGER: [ROLE_STUDENT, ROLE_QUESTION_MANAGER]
  20. ROLE_SESSION_MANAGER: [ROLE_STUDENT, ROLE_SESSION_MANAGER, ROLE_ALLOWED_TO_SWITCH]
  21. ROLE_STUDENT: [ROLE_STUDENT]
  22. ROLE_CURRENT_TEACHER: []
  23. ROLE_CURRENT_COURSE_STUDENT: [ROLE_CURRENT_COURSE_STUDENT]
  24. ROLE_CURRENT_COURSE_TEACHER: [ROLE_CURRENT_COURSE_TEACHER, ROLE_CURRENT_COURSE_STUDENT]
  25. ROLE_ANONYMOUS: [ROLE_ANONYMOUS]
  26. access_decision_manager:
  27. # strategy can be: affirmative, unanimous or consensus
  28. strategy: unanimous
  29. providers:
  30. fos_userbundle:
  31. id: fos_user.user_manager
  32. firewalls:
  33. dev:
  34. pattern: ^/(_(profiler|wdt)|css|images|js|admin/_(wdt|profiler)|api/_(wdt|profiler))/
  35. security: false
  36. install:
  37. pattern: /installer/(.*)
  38. security: false
  39. anonymous: true
  40. admin:
  41. pattern: /administration(.*)
  42. context: user
  43. form_login:
  44. provider: fos_userbundle
  45. login_path: /administration/login
  46. use_forward: false
  47. check_path: /administration/login_check
  48. failure_path: null
  49. logout:
  50. path: /administration/logout
  51. anonymous: true
  52. main:
  53. pattern: .*
  54. context: user
  55. form_login:
  56. provider: fos_userbundle
  57. login_path: /login
  58. use_forward: false
  59. check_path: /login_check
  60. failure_path: null
  61. default_target_path: /
  62. success_handler: chamilo_core.listener.login_success_handler
  63. logout:
  64. path: /logout
  65. target: /
  66. success_handler: chamilo_core.listener.logout_success_handler
  67. invalidate_session: false
  68. handlers: ['sonata.page.cms_manager_selector']
  69. anonymous: true
  70. access_control:
  71. # URL of FOSUserBundle which need to be available to anonymous users
  72. - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  73. - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
  74. - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
  75. # Admin login page needs to be access without credential
  76. - { path: ^/administration/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  77. - { path: ^/administration/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  78. - { path: ^/administration/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  79. # Secured part of the site
  80. # This config requires being logged for the whole site and having the admin role for the admin part.
  81. # Change these rules to adapt them to your needs
  82. - { path: ^/administration/, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
  83. - { path: ^/profile/, role: IS_AUTHENTICATED_FULLY }
  84. - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
  85. # acl:
  86. # connection: default