security:
    access_decision_manager:
      # Strategy can be: affirmative, unanimous or consensus
      strategy: unanimous
    encoders:
        #Symfony\Component\Security\Core\User\User: plaintext
        Sigza\CoreBundle\Entity\Usuario: sha512

    role_hierarchy:
        ROLE_ADMIN:       [ROLE_JEFE_LAB, ROLE_TECNICO_LAB, ROLE_BALANZA, ROLE_PRODUCTOR]
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        #in_memory:
            #memory:
                #users:
                    #user:  { password: userpass, roles: [ 'ROLE_USER' ] }
                    #admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
         user_db:
             entity: { class: Sigza\CoreBundle\Entity\Usuario, property: usuario}

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        #login:
            #pattern:  ^/demo/secured/login$
            #security: false

        #secured_area:
            #pattern:    ^/demo/secured/
            #form_login:
                #check_path: /login_check
                #login_path: /login
                #username_parameter: _username
                #password_parameter: _password
            #logout:
                #path:   _demo_logout
                #target: _demo

        sigza:
            pattern: ^/
            anonymous: ~
            form_login:
              username_parameter: "Usuario[username]"
              password_parameter: "Usuario[password]"
              csrf_parameter: "Usuario[_token]"
              #csrf_provider: form.csrf_provider
              intention: authentication
              login_path: /login/
              check_path: /check/
            logout:
              path: /logout/
              target: /login/
            #anonymous: ~
            #http_basic:
            #    realm: "Secured Demo Area"

    access_control:
        #- { path: ^/demo/secured/hello/admin/, roles: ROLE_ADMIN }
        #- { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/, roles: [ROLE_ADMIN] }
        - { path: ^/balanza/, roles: [ROLE_BALANZA] }
        - { path: ^/laboratorio/listar/, roles: [ROLE_JEFE_LAB] }
        - { path: ^/laboratorio/, roles: [ROLE_TECNICO_LAB] }
        - { path: ^/productor/, roles: [ROLE_PRODUCTOR] }
        #- { path: ^/, roles: [ROLE_BALANZA, ROLE_JEFE_LAB, ROLE_TECNICO_LAB, ROLE_PRODUCTOR] }

