initial commit && create project in symfony3
This commit is contained in:
30
app/config/security.yml
Normal file
30
app/config/security.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
security:
|
||||
encoders:
|
||||
FOS\UserBundle\Model\UserInterface: bcrypt
|
||||
|
||||
role_hierarchy:
|
||||
ROLE_ADMIN: ROLE_USER
|
||||
ROLE_SUPER_ADMIN: ROLE_ADMIN
|
||||
|
||||
providers:
|
||||
fos_userbundle:
|
||||
id: fos_user.user_provider.username
|
||||
|
||||
firewalls:
|
||||
main:
|
||||
pattern: ^/
|
||||
form_login:
|
||||
provider: fos_userbundle
|
||||
csrf_token_generator: security.csrf.token_manager
|
||||
default_target_path: /admin
|
||||
# if you are using Symfony < 2.8, use the following config instead:
|
||||
# csrf_provider: form.csrf_provider
|
||||
|
||||
logout: true
|
||||
anonymous: true
|
||||
|
||||
access_control:
|
||||
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/admin, role: ROLE_SUPER_ADMIN }
|
||||
Reference in New Issue
Block a user