jms_security_extra:
    secure_all_services: false
    expressions: true

security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        main:
            entity: { class: Kavli\KavliBundle\Entity\Admin, property: username }

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

        login:
            pattern:  ^/admin/login$
            security: false

        secured_area:
            pattern:    ^/admin
            form_login:
                check_path: /admin/login_check
                login_path: /admin/login
            logout:
                path:   /admin/logout
                target: /
            remember_me:
                key:      "admin_secret_1245384759347685934"
                lifetime: 31536000 # 365 days in seconds
                path:     /
                domain:   ~ # Defaults to the current domain from $_SERVER
    encoders:
        Kavli\KavliBundle\Entity\Admin:
            algorithm:   sha1
            iterations: 1
            encode_as_base64: false
        Kavli\KavliBundle\Entity\User:
            algorithm:   sha1
            iterations: 1
            encode_as_base64: false

    access_control:
        #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
        #
        # You must uncomment the two following rules to restrict access to paths
        # starting with the /_internal prefix to only localhost
        #- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
        #- { path: ^/_internal/secure, roles: ROLE_NO_ACCESS }
