parameters:
    cce_student.manager.class: App\UserBundle\Services\CCEStudentManager
    iga_user_provider.class: danvbe\UserBundle\Security\Core\User\FOSUBUserProvider
    user_level.manager.class: App\UserBundle\Services\UserLevelManager
    user_list.manager.class: App\UserBundle\Services\UserListManager
    user_list_old.manager.class: App\UserBundle\Services\UserListOldManager

services:
    iga.user.admin.user_level:
        class: App\UserBundle\Admin\UserLevelAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: System, label: User Levels, audit: false, model_class: App\UserBundle\Entity\UserLevel }
        calls:
            - [ setContainer, ["@service_container"] ]
    iga.user.admin.user_list:
        class: App\UserBundle\Admin\UserListAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: System, label: Users, audit: false, model_class: App\UserBundle\Entity\UserList }
        calls:
            - [ setSecurityContext, ["@security.token_storage"] ]
            - [ setEntityManager, [ "@doctrine.orm.entity_manager" ] ]
            - [ setContainer, ["@service_container"] ]
    cce_student.manager:
        class: "%cce_student.manager.class%"
        public: true
        shared: true
        arguments: ['@service_container']
    oauth.manager:
        class: App\UserBundle\Services\OauthManager
        shared: true
        arguments: ['@service_container']
    user_level.manager:
        class: "%user_level.manager.class%"
        public: true
        shared: true
        arguments: ['@service_container']
    user_list.manager:
        class: "%user_list.manager.class%"
        public: true
        shared: true
        arguments: ['@service_container']
        calls:
            - [ setSecurityContext, ["@security.token_storage"] ]
    user_list_old.manager:
        class: "%user_list_old.manager.class%"
        public: true
        shared: true
        arguments: ['@service_container']
        calls:
            - [ setSecurityContext, ["@security.token_storage"] ]
    iga.user.validator.user_exists:
        class: App\UserBundle\Validator\Constraints\UserExistsValidator
        tags:
            - { name: validator.constraint_validator, alias: user_exists_validator }
        calls:
            - [ setSecurityContext, ["@security.token_storage"] ]
            - [ setContainer, ["@service_container"] ]
#    security.access.blacklist_voter:
#        class:      UserBundle\Security\Authorization\Voter\UserAclVoter
#        arguments:  [ "@service_container" ]
#        public:     false
#        tags:
#            - { name: security.voter }
    entry_point.user_login:
        class: App\UserBundle\Services\LoginEntryPoint
        arguments: [ "@router", "@service_container" ]
    iga_user.authentication.handler.login_success_handler:
        class:  App\UserBundle\Security\LoginSuccessHandler
        arguments:  ["@service_container", "@router"]
        tags:
            - { name: 'monolog.logger', channel: 'security' }
    iga_user.authentication.handler.login_failure_handler:
        class:  App\UserBundle\Security\LoginFailureHandler
        arguments:  ["@service_container", "@router", "@security.token_storage"]
        tags:
            - { name: 'monolog.logger', channel: 'security' }
    iga_user.authentication.handler.logout_success_handler:
        class:  App\UserBundle\Security\LogoutSuccessHandler
        arguments:  ["@service_container", "@router", "@security.token_storage"]
        tags:
            - name: 'kernel.event_listener'
              event: 'Symfony\Component\Security\Http\Event\LogoutEvent'
              dispatcher: security.event_dispatcher.main
#    iga_user_provider:
#        id: iga.user.provider
#        class: App\UserBundle\Auth\OAuthProvider
#        arguments: ["@session.factory", "@doctrine", "@service_container"]
    iga.user.form.type.user_register:
        class: App\UserBundle\Form\Type\UserRegisterType
        arguments: ['@service_container']
        tags:
            - { name: form.type, alias: user_register }