Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Security.yml
- security:
- encoders:
- Symfony\Component\Security\Core\User\User: plaintext
- providers:
- #in_memory:
- #users:
- # user: { password: userpass, roles: [ 'ROLE_USER' ] }
- # admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
- fos_userbundle:
- id: fos_user.user_manager
- firewalls:
- admin_office:
- pattern: /office/.*
- switch_user: true
- form-login:
- provider: fos_userbundle
- login_path: /login
- use_forward: false
- check_path: /login_check
- failure_path: null
- logout: true
- company_office:
- pattern: /gestao/empresa/.*
- form-login:
- provider: fos_userbundle
- login_path: /login
- use_forward: false
- check_path: /login_check
- failure_path: null
- logout: true
- anonymous: true
- public:
- pattern: .*
- form-login:
- provider: fos_userbundle
- login_path: /login
- use_forward: false
- check_path: /login_check
- failure_path: null
- logout: true
- anonymous: true
- access_control:
- # The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
- - { path: ^/_wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/_profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- # AsseticBundle paths used when using the controller for assets
- - { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- # URL of FOSUserBundle which need to be available to anonymous users
- - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY } # for the case of a failed login
- - { path: ^/user/new$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/check-confirmation-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/confirm/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/confirmed$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/request-reset-password$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/send-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/check-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user/reset-password/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- # Secured part of the site
- # This config requires being logged for the whole site and having the admin role for the admin part.
- # Change these rules to adapt them to your needs
- - { path: /gestao/empresa/.*, role: ROLE_SUPERADMIN }
- - { path: /office/.*, role: ROLE_ADMIN }
- #- { path: ^/.*, role: ROLE_USER }
- role_hierarchy:
- ROLE_ADMIN: ROLE_USER
- ROLE_SUPERADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
- acl:
- connection: default
- ## Config.yml
- imports:
- - { resource: parameters.ini }
- - { resource: security.yml }
- framework:
- charset: UTF-8
- error_handler: null
- csrf_protection:
- enabled: true
- secret: %csrf_secret%
- router: { resource: "%kernel.root_dir%/config/routing.yml" }
- validation: { enabled: true, annotations: true }
- templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
- session:
- default_locale: %locale%
- lifetime: 3600
- auto_start: true
- # Twig Configuration
- twig:
- debug: %kernel.debug%
- strict_variables: %kernel.debug%
- # Assetic Configuration
- assetic:
- debug: %kernel.debug%
- use_controller: false
- filters:
- cssrewrite: ~
- # closure:
- # jar: %kernel.root_dir%/java/compiler.jar
- # yui_css:
- # jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar
- # Doctrine Configuration
- doctrine:
- dbal:
- default_connection: default
- connections:
- default:
- driver: %database_driver%
- host: %database_host%
- dbname: %database_name%
- user: %database_user%
- password: %database_password%
- orm:
- auto_generate_proxy_classes: %kernel.debug%
- default_entity_manager: default
- entity_managers:
- default:
- mappings:
- GuiaWebMainBundle: ~
- GuiaWebCompanyBundle: ~
- FOSUserBundle: ~
- GuiaWebUserBundle: ~
- jms_security_extra:
- secure_controllers: true
- secure_all_services: false
- # FOS/UserBundle Configuration
- fos_user:
- db_driver: orm
- firewall_name: company_office
- firewall_name: admin_office
- class:
- model:
- user: GuiaWeb\UserBundle\Entity\User
- group:
- class:
- model: GuiaWeb\UserBundle\Entity\Role
- encoder:
- algorithm: sha512
- encode_as_base64: true
- iterations: 5
Add Comment
Please, Sign In to add comment