security:
    encoders:
        Symfony\Component\Security\Core\User\User:
            algorithm:        sha1
            encode_as_base64: false
            iterations:       1
        Acme\AdminBundle\Entity\Admin:
            algorithm:        sha1
            encode_as_base64: false
            iterations:       1

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

    providers:
        admin:
            entity: { class: AcmeAccountBundle:Admin, property: username }
        account:
            entity:
                class: Acme\AccountBundle\Entity\Employee
                property: username   

     
    firewalls:
        admin:
           pattern:    ^/admin
           form_login:
             login_path: admin_login
             check_path: admin_login_check
             default_target_path: admin_acme_admin_bundle_ds
           logout:
                path: admin_logout
                target: admin_login
           anonymous:  true
           context:    application
    

        account:
            pattern: /.*

            form_login:
                login_path: /account/login
                check_path: /login_check
                remember_me: true
            logout:
                path: /logout
                target: /
            remember_me:
                key: MiPassphrase
                lifetime: 1800
                path: /.*
                domain: ~
            security: true
            anonymous: true
    access_control:
        - { path: /login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: /.*, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/logout$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/login_check$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/, roles: ROLE_ADMIN }