milardovich

security.ym

Aug 21st, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.07 KB | None | 0 0
  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: bcrypt
  6.  
  7.     role_hierarchy:
  8.         ROLE_ADMIN:      ROLE_USER
  9.         ROLE_SUPER_ADMIN: ROLE_ADMIN
  10.  
  11.     providers:
  12.         fos_userbundle:
  13.             id: fos_user.user_provider.username
  14.  
  15.     firewalls:
  16.         main:
  17.             pattern: ^/
  18.             form_login:
  19.                 provider: fos_userbundle
  20.                 csrf_token_generator: security.csrf.token_manager
  21.                 # if you are using Symfony < 2.8, use the following config instead:
  22.                 # csrf_provider: form.csrf_provider
  23.  
  24.             logout:      true
  25.             anonymous:   true
  26.  
  27.     access_control:
  28.         - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  29.         - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
  30.         - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
  31.         - { path: ^/admin/, role: ROLE_ADMIN }
  32.         - { path: ^/, role: ROLE_USER }
Advertisement
Add Comment
Please, Sign In to add comment