Created
June 25, 2022 08:52
-
-
Save cmdr-rohit-bang/3158f0c6195d2d9686fee199b5be20ca to your computer and use it in GitHub Desktop.
/project/config/packages/security.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/packages/security.yaml | |
security: | |
encoders: | |
FOS\UserBundle\Model\UserInterface: bcrypt | |
role_hierarchy: | |
ROLE_ADMIN: ROLE_USER | |
ROLE_SUPER_ADMIN: ROLE_ADMIN | |
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers | |
providers: | |
fos_userbundle: | |
id: fos_user.user_provider.username_email | |
firewalls: | |
dev: | |
pattern: ^/(_(profiler|wdt)|css|images|js)/ | |
security: false | |
main: | |
pattern: ^/ | |
form_login: | |
provider: fos_userbundle | |
csrf_token_generator: security.csrf.token_manager | |
logout: true | |
anonymous: true | |
# Easy way to control access for large sections of your site | |
# Note: Only the *first* access control that matches will be used | |
access_control: | |
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } | |
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } | |
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } | |
- { path: ^/admin/, role: ROLE_ADMIN } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment