security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        user_provider:
            entity:
                class: App\Entity\Usuario
                property: usuario
    encoders:
        App\Entity\Usuario:
            algorithm: bcrypt
            cost: 4
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: lazy
            provider: user_provider
            form_login:
                login_path: login
                check_path: loginCheck
            logout:
                path: logout
                target: index
            remember_me:
                secret:   '%kernel.secret%'
                path:     /
            guard:
                authenticators:
                    - App\Security\LoginFormAuthenticator

            # activate different ways to authenticate
            # https://symfony.com/doc/current/security.html#firewalls-authentication

            # https://symfony.com/doc/current/security/impersonating_user.html
            # switch_user: 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: ^/admin/perfil-fabricante, roles: ROLE_MANUFACTURER }
         - { path: ^/admin/subir-imagenes-fabricante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-imagen-fabricante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/sugerir-atributo, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/listado-colecciones, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/nueva-coleccion, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/editar-coleccion, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-coleccion, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/nueva-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/listado-piezas, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/gestionar-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/nueva-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/galeria-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/editar-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/activar-variantes-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/desactivar-variantes-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/subir-imagenes-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-imagen-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/principal-imagen-pieza, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/subir-imagenes-ambiente, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-imagen-ambiente, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/principal-imagen-ambiente, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/predeterminada-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/cambiar-estado-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/copiar-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/eliminar-variante, roles: [ROLE_ADMIN, ROLE_MANUFACTURER] }
         - { path: ^/admin/perfil-central-de-compra, roles: ROLE_SHOPPING_CENTER }
         - { path: ^/admin/listado-central-de-compra-empresas, roles: [ROLE_ADMIN, ROLE_SHOPPING_CENTER] }
         - { path: ^/admin/perfil-empresa, roles: ROLE_COMPANY }
         - { path: ^/admin/listado-distribuidores, roles: [ROLE_ADMIN, ROLE_COMPANY] }
         - { path: ^/admin/nuevo-distribuidor, roles: [ROLE_ADMIN, ROLE_COMPANY] }
         - { path: ^/admin/editar-distribuidor, roles: [ROLE_ADMIN, ROLE_COMPANY] }
         - { path: ^/admin/eliminar-distribuidor, roles: [ROLE_ADMIN, ROLE_COMPANY] }
         - { path: ^/admin/cambiar-estado-usuario, roles: [ROLE_ADMIN, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/listado-comerciales, roles: [ROLE_ADMIN, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/nuevo-comercial, roles: [ROLE_ADMIN, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/editar-comercial, roles: [ROLE_ADMIN, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/eliminar-comercial, roles: [ROLE_ADMIN, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/perfil-distribuidor, roles: ROLE_DISTRIBUTOR }
         - { path: ^/admin/subir-imagenes-distribuidor, roles: [ROLE_ADMIN, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/eliminar-imagen-distribuidor, roles: [ROLE_ADMIN, ROLE_DISTRIBUTOR] }
         - { path: ^/admin/listado-productos-distribuidor, roles: [ROLE_DISTRIBUTOR, ROLE_COMMERCIAL] }
         - { path: ^/admin/administrar-productos-distribuidor, roles: [ROLE_DISTRIBUTOR, ROLE_COMMERCIAL] }
         - { path: ^/admin/agregar-variante-distribuidor, roles: [ROLE_DISTRIBUTOR, ROLE_COMMERCIAL] }
         - { path: ^/admin/desvincular-variante-distribuidor, roles: [ROLE_DISTRIBUTOR, ROLE_COMMERCIAL] }
         - { path: ^/admin/totem, roles: ROLE_TOTEM }
         - { path: ^/admin/perfil-comercial, roles: ROLE_COMMERCIAL }
         - { path: ^/admin/inicio, roles: [ROLE_ADMIN, ROLE_MANUFACTURER, ROLE_DISTRIBUTOR, ROLE_SHOPPING_CENTER, ROLE_COMPANY, ROLE_COMMERCIAL, ROLE_TOTEM, ROLE_USER] }
         - { path: ^/admin/volver-listado, roles: [ROLE_ADMIN, ROLE_MANUFACTURER, ROLE_COMPANY, ROLE_DISTRIBUTOR] }
         - { path: ^/admin, roles: ROLE_ADMIN }
         - { path: ^/en/account/panels$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
         - { path: ^/en/account/favorites, roles: IS_AUTHENTICATED_ANONYMOUSLY }
         - { path: ^/en/account, roles: ROLE_USER }
         - { path: ^/es/cuenta/paneles$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
         - { path: ^/es/cuenta/favoritos, roles: IS_AUTHENTICATED_ANONYMOUSLY }
         - { path: ^/es/cuenta, roles: ROLE_USER }
    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN
