# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:

    # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
    providers:
#        in_memory:
#            memory: ~
        fos_userbundle:
            id: fos_user.user_provider.username


    firewalls:
        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            anonymous: ~

            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_token_generator: security.csrf.token_manager
                # if you are using Symfony < 2.8, use the following config instead:
                # csrf_provider: form.csrf_provider

            logout:
                path: 'fos_user_security_logout'
                target: /
                invalidate_session: true

            anonymous:    true
            # activate different ways to authenticate

            # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
            #http_basic: ~

            # https://symfony.com/doc/current/security/form_login_setup.html
            #form_login: ~
    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_REP_INTERACCION, ROLE_REP_CHAT, ROLE_DASHBOARD]

    access_control:
            - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY  }
            - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/, role: ROLE_USER }
            - { path: ^/, role: ROLE_REPORTS }
            - { path: ^/, role: ROLE_CLAVES }



#        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https, host: reportes\.chattigo\.com$  }
#        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY,requires_channel: https, host: reportes\.chattigo\.com$  }
#        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https, host: reportes\.chattigo\.com$  }
#        - { path: ^/, role: ROLE_USER, requires_channel: https, host: reportes\.chattigo\.com$  }
