<?xml version="1.0" encoding="UTF-8"?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="security.secured_services" type="collection"></parameter>
    
        <parameter key="security.access.method_interceptor.class">JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor</parameter>

        <parameter key="security.access.run_as_manager.class">JMS\SecurityExtraBundle\Security\Authorization\RunAsManager</parameter>
        <parameter key="security.authentication.provider.run_as.class">JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider</parameter>
        <parameter key="security.run_as.key">RunAsToken</parameter>
        <parameter key="security.run_as.role_prefix">ROLE_</parameter>

        <parameter key="security.access.after_invocation_manager.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager</parameter>
        <parameter key="security.access.after_invocation.acl_provider.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider</parameter>
        
        <parameter key="security.extra.controller_listener.class">JMS\SecurityExtraBundle\Controller\ControllerListener</parameter>
        
        <parameter key="security.access.iddqd_voter.class">JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter</parameter>
    </parameters>

    <services>
        <service id="security.access.run_as_manager" class="%security.access.run_as_manager.class%" public="false">
            <argument>%security.run_as.key%</argument>
            <argument>%security.run_as.role_prefix%</argument>
        </service>
    
        <service id="security.access.method_interceptor" class="%security.access.method_interceptor.class%">
            <argument type="service" id="security.context" />
            <argument type="service" id="security.authentication.manager" />
            <argument type="service" id="security.access.decision_manager" />
            <argument type="service" id="security.access.after_invocation_manager" />
            <argument type="service" id="security.access.run_as_manager" />
            <argument type="service" id="logger" on-invalid="null" />
        </service>
            
        <service id="security.access.after_invocation_manager" class="%security.access.after_invocation_manager.class%" public="false">
            <argument type="collection"></argument>
        </service>
        
        <service id="security.access.after_invocation.acl_provider" class="%security.access.after_invocation.acl_provider.class%" public="false">
            <argument type="service" id="security.acl.provider" />
            <argument type="service" id="security.acl.object_identity_retrieval_strategy" />
            <argument type="service" id="security.acl.security_identity_retrieval_strategy" />
            <argument type="service" id="security.acl.permission.map" />
            <tag name="security.after_invocation.provider" />
        </service>
        
        <service id="security.extra.iddqd_voter" class="%security.access.iddqd_voter.class%" public="false">
        </service>
        
        <service id="security.extra.controller_listener" class="%security.extra.controller_listener.class%">
            <tag name="kernel.event_listener" event="kernel.controller" method="onCoreController" priority="-255" />
            <argument type="service" id="service_container" />
            <argument type="service" id="annotation_reader" />
        </service>
    </services>

</container>