Guest User

Untitled

a guest
Jan 5th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. ### Security.yml
  2.  
  3.  
  4. security:
  5. encoders:
  6. Symfony\Component\Security\Core\User\User: plaintext
  7.  
  8. providers:
  9. #in_memory:
  10. #users:
  11. # user: { password: userpass, roles: [ 'ROLE_USER' ] }
  12. # admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
  13. fos_userbundle:
  14. id: fos_user.user_manager
  15.  
  16. firewalls:
  17. admin_office:
  18. pattern: /office/.*
  19. switch_user: true
  20. form-login:
  21. provider: fos_userbundle
  22. login_path: /login
  23. use_forward: false
  24. check_path: /login_check
  25. failure_path: null
  26. logout: true
  27.  
  28. company_office:
  29. pattern: /gestao/empresa/.*
  30. form-login:
  31. provider: fos_userbundle
  32. login_path: /login
  33. use_forward: false
  34. check_path: /login_check
  35. failure_path: null
  36. logout: true
  37. anonymous: true
  38.  
  39. public:
  40. pattern: .*
  41. form-login:
  42. provider: fos_userbundle
  43. login_path: /login
  44. use_forward: false
  45. check_path: /login_check
  46. failure_path: null
  47. logout: true
  48. anonymous: true
  49.  
  50.  
  51. access_control:
  52. # The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
  53. - { path: ^/_wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  54. - { path: ^/_profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  55. # AsseticBundle paths used when using the controller for assets
  56. - { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  57. - { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  58. # URL of FOSUserBundle which need to be available to anonymous users
  59. - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  60. - { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY } # for the case of a failed login
  61. - { path: ^/user/new$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  62. - { path: ^/user/check-confirmation-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  63. - { path: ^/user/confirm/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  64. - { path: ^/user/confirmed$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  65. - { path: ^/user/request-reset-password$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  66. - { path: ^/user/send-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  67. - { path: ^/user/check-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  68. - { path: ^/user/reset-password/, role: IS_AUTHENTICATED_ANONYMOUSLY }
  69. # Secured part of the site
  70. # This config requires being logged for the whole site and having the admin role for the admin part.
  71. # Change these rules to adapt them to your needs
  72. - { path: /gestao/empresa/.*, role: ROLE_SUPERADMIN }
  73. - { path: /office/.*, role: ROLE_ADMIN }
  74. #- { path: ^/.*, role: ROLE_USER }
  75.  
  76. role_hierarchy:
  77. ROLE_ADMIN: ROLE_USER
  78. ROLE_SUPERADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  79.  
  80. acl:
  81. connection: default
  82.  
  83.  
  84. ## Config.yml
  85.  
  86. imports:
  87. - { resource: parameters.ini }
  88. - { resource: security.yml }
  89.  
  90. framework:
  91. charset: UTF-8
  92. error_handler: null
  93. csrf_protection:
  94. enabled: true
  95. secret: %csrf_secret%
  96. router: { resource: "%kernel.root_dir%/config/routing.yml" }
  97. validation: { enabled: true, annotations: true }
  98. templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
  99. session:
  100. default_locale: %locale%
  101. lifetime: 3600
  102. auto_start: true
  103.  
  104. # Twig Configuration
  105. twig:
  106. debug: %kernel.debug%
  107. strict_variables: %kernel.debug%
  108.  
  109. # Assetic Configuration
  110. assetic:
  111. debug: %kernel.debug%
  112. use_controller: false
  113. filters:
  114. cssrewrite: ~
  115. # closure:
  116. # jar: %kernel.root_dir%/java/compiler.jar
  117. # yui_css:
  118. # jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar
  119.  
  120. # Doctrine Configuration
  121. doctrine:
  122. dbal:
  123. default_connection: default
  124. connections:
  125. default:
  126. driver: %database_driver%
  127. host: %database_host%
  128. dbname: %database_name%
  129. user: %database_user%
  130. password: %database_password%
  131.  
  132. orm:
  133. auto_generate_proxy_classes: %kernel.debug%
  134. default_entity_manager: default
  135. entity_managers:
  136. default:
  137. mappings:
  138. GuiaWebMainBundle: ~
  139. GuiaWebCompanyBundle: ~
  140. FOSUserBundle: ~
  141. GuiaWebUserBundle: ~
  142.  
  143. jms_security_extra:
  144. secure_controllers: true
  145. secure_all_services: false
  146.  
  147.  
  148. # FOS/UserBundle Configuration
  149.  
  150. fos_user:
  151. db_driver: orm
  152. firewall_name: company_office
  153. firewall_name: admin_office
  154. class:
  155. model:
  156. user: GuiaWeb\UserBundle\Entity\User
  157. group:
  158. class:
  159. model: GuiaWeb\UserBundle\Entity\Role
  160. encoder:
  161. algorithm: sha512
  162. encode_as_base64: true
  163. iterations: 5
Add Comment
Please, Sign In to add comment