security.yaml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # To get started with security, check out the documentation:
  2. # http://symfony.com/doc/current/book/security.html
  3. security:
  4. encoders:
  5. FOS\UserBundle\Model\UserInterface:
  6. id: Chamilo\UserBundle\Security\Encoder
  7. # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
  8. providers:
  9. fos_userbundle:
  10. id: fos_user.user_provider.username
  11. access_control:
  12. - {path: ^/administrator, role: ROLE_ADMIN}
  13. - {path: ^/efconnect, role: ROLE_USER}
  14. - {path: ^/elfinder, role: ROLE_USER}
  15. - {path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY}
  16. role_hierarchy:
  17. ROLE_SONATA_ADMIN: ROLE_USER
  18. ROLE_ADMIN:
  19. - ROLE_SUPER_ADMIN
  20. - ROLE_SONATA_ADMIN
  21. - ROLE_QUESTION_MANAGER
  22. - ROLE_SESSION_MANAGER
  23. - ROLE_TEACHER
  24. - ROLE_DIRECTOR
  25. - ROLE_JURY_PRESIDENT
  26. - ROLE_CURRENT_COURSE_TEACHER
  27. - SONATA
  28. ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  29. ROLE_GLOBAL_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  30. ROLE_RRHH: [ROLE_TEACHER]
  31. ROLE_TEACHER: [ROLE_STUDENT]
  32. ROLE_QUESTION_MANAGER: [ROLE_STUDENT, ROLE_QUESTION_MANAGER]
  33. ROLE_SESSION_MANAGER: [ROLE_STUDENT, ROLE_SESSION_MANAGER, ROLE_ALLOWED_TO_SWITCH]
  34. ROLE_STUDENT: [ROLE_STUDENT]
  35. ROLE_CURRENT_TEACHER: []
  36. ROLE_CURRENT_COURSE_STUDENT: [ROLE_CURRENT_COURSE_STUDENT] # Set in the course listener
  37. ROLE_CURRENT_COURSE_TEACHER: [ROLE_CURRENT_COURSE_TEACHER, ROLE_CURRENT_COURSE_STUDENT] # Set in the course listener
  38. ROLE_CURRENT_SESSION_COURSE_STUDENT: [ROLE_CURRENT_SESSION_COURSE_STUDENT]
  39. ROLE_CURRENT_SESSION_COURSE_TEACHER: [ROLE_CURRENT_SESSION_COURSE_STUDENT, ROLE_CURRENT_SESSION_COURSE_TEACHER]
  40. SONATA:
  41. - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are not using acl then this line must be uncommented
  42. - ROLE_SONATA_PAGE_ADMIN_BLOCK_EDIT
  43. ROLE_ANONYMOUS: [ROLE_ANONYMOUS]
  44. #access_decision_manager:
  45. # strategy can be: affirmative, unanimous or consensus
  46. # only grant access if none of the voters has denied access
  47. #strategy: unanimous
  48. firewalls:
  49. # disables authentication for assets and the profiler, adapt it according to your needs
  50. dev:
  51. pattern: ^/(_(profiler|wdt)|css|images|js)/
  52. anonymous: true
  53. admin:
  54. pattern: ^/
  55. context: admin
  56. anonymous: true
  57. form_login:
  58. provider: fos_userbundle
  59. csrf_token_generator: security.csrf.token_manager
  60. login_path: /login
  61. use_forward: false
  62. check_path: /login
  63. # success_handler: chamilo_core.listener.login_success_handler
  64. failure_path: null
  65. guard:
  66. authenticators:
  67. - chamilo_user.security.login_form_authenticator
  68. remember_me:
  69. secret: '%secret%'
  70. lifetime: 604800 # 1 week in seconds
  71. path: /
  72. logout:
  73. path: /logout
  74. target: /
  75. switch_user: false
  76. oauth:
  77. resource_owners:
  78. facebook: "/login/check-facebook"
  79. google: "/login/check-google"
  80. github: "/login/check-github"
  81. login_path: /login
  82. failure_path: /login
  83. use_forward: false
  84. oauth_user_provider:
  85. service: chamilo_user.security.user_provider