<?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="sonata.admin.security.handler.noop.class" >Sonata\AdminBundle\Security\Handler\NoopSecurityHandler</parameter>
        <parameter key="sonata.admin.security.handler.role.class" >Sonata\AdminBundle\Security\Handler\RoleSecurityHandler</parameter>
        <parameter key="sonata.admin.security.handler.acl.class" >Sonata\AdminBundle\Security\Handler\AclSecurityHandler</parameter>
        <parameter key="sonata.admin.security.mask.builder.class" >Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder</parameter>
        <parameter key="sonata.admin.manipulator.acl.admin.class">Sonata\AdminBundle\Util\AdminAclManipulator</parameter>
        <parameter key="sonata.admin.object.manipulator.acl.admin.class">Sonata\AdminBundle\Util\AdminObjectAclManipulator</parameter>
    </parameters>

    <services>
        <service id="sonata.admin.security.handler.noop" class="%sonata.admin.security.handler.noop.class%" public="false" />
        <service id="sonata.admin.security.handler.role" class="%sonata.admin.security.handler.role.class%" public="false">
            <argument type="service" id="security.context" on-invalid="null" />
            <argument type="collection">
                <argument>ROLE_SUPER_ADMIN</argument>
            </argument>
        </service>
        <service id="sonata.admin.security.handler.acl" class="%sonata.admin.security.handler.acl.class%" public="false">
            <argument type="service" id="security.context" on-invalid="null" />
            <argument type="service" id="security.acl.provider" on-invalid="null" />
            <argument>%sonata.admin.security.mask.builder.class%</argument>
            <argument type="collection">
                <argument>ROLE_SUPER_ADMIN</argument>
            </argument>
            <call method="setAdminPermissions">
                <argument>%sonata.admin.configuration.security.admin_permissions%</argument>
            </call>
            <call method="setObjectPermissions">
                <argument>%sonata.admin.configuration.security.object_permissions%</argument>
            </call>
        </service>
        <service id="sonata.admin.manipulator.acl.admin" class="%sonata.admin.manipulator.acl.admin.class%" >
            <argument>%sonata.admin.security.mask.builder.class%</argument>
        </service>
        <service id="sonata.admin.object.manipulator.acl.admin" class="%sonata.admin.object.manipulator.acl.admin.class%">
            <argument type="service" id="form.factory"/>
            <argument>%sonata.admin.security.mask.builder.class%</argument>
        </service>
    </services>
</container>
