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

<!--
 This file is part of the FOSCommentBundle package.

 (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>

 This source file is subject to the MIT license that is bundled
 with this source code in the file LICENSE.
-->

<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="fos_comment.manager.thread.acl.class">FOS\CommentBundle\Acl\AclThreadManager</parameter>
        <parameter key="fos_comment.manager.comment.acl.class">FOS\CommentBundle\Acl\AclCommentManager</parameter>
        <parameter key="fos_comment.manager.vote.acl.class">FOS\CommentBundle\Acl\AclVoteManager</parameter>
    </parameters>

    <services>
        <service id="fos_comment.acl.thread.security" class="FOS\CommentBundle\Acl\SecurityThreadAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument type="service" id="security.acl.object_identity_retrieval_strategy" />
            <argument type="service" id="security.acl.provider" />
            <argument>%fos_comment.model.thread.class%</argument>
        </service>

        <service id="fos_comment.acl.comment.security" class="FOS\CommentBundle\Acl\SecurityCommentAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument type="service" id="security.acl.object_identity_retrieval_strategy" />
            <argument type="service" id="security.acl.provider" />
            <argument>%fos_comment.model.comment.class%</argument>
        </service>

        <service id="fos_comment.acl.vote.security" class="FOS\CommentBundle\Acl\SecurityVoteAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument type="service" id="security.acl.object_identity_retrieval_strategy" />
            <argument type="service" id="security.acl.provider" />
            <argument>%fos_comment.model.vote.class%</argument>
        </service>

        <service id="fos_comment.acl.thread.roles" class="FOS\CommentBundle\Acl\RoleThreadAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument /> <!-- Create role -->
            <argument /> <!-- View role -->
            <argument /> <!-- Edit role -->
            <argument /> <!-- Delete role -->
            <argument>%fos_comment.model.thread.class%</argument>
        </service>

        <service id="fos_comment.acl.comment.roles" class="FOS\CommentBundle\Acl\RoleCommentAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument /> <!-- Create role -->
            <argument /> <!-- View role -->
            <argument /> <!-- Edit role -->
            <argument /> <!-- Delete role -->
            <argument>%fos_comment.model.comment.class%</argument>
        </service>

        <service id="fos_comment.acl.vote.roles" class="FOS\CommentBundle\Acl\RoleVoteAcl" public="false">
            <argument type="service" id="security.authorization_checker" />
            <argument /> <!-- Create role -->
            <argument /> <!-- View role -->
            <argument /> <!-- Edit role -->
            <argument /> <!-- Delete role -->
            <argument>%fos_comment.model.vote.class%</argument>
        </service>

        <service id="fos_comment.manager.thread.acl" class="%fos_comment.manager.thread.acl.class%" public="false">
            <argument type="service" id="fos_comment.manager.thread.default" />
            <argument type="service" id="fos_comment.acl.thread" />
        </service>

        <service id="fos_comment.manager.comment.acl" class="%fos_comment.manager.comment.acl.class%" public="false">
            <argument type="service" id="fos_comment.manager.comment.default" />
            <argument type="service" id="fos_comment.acl.comment" />
            <argument type="service" id="fos_comment.acl.thread" />
        </service>

        <service id="fos_comment.manager.vote.acl" class="%fos_comment.manager.vote.acl.class%" public="false">
            <argument type="service" id="fos_comment.manager.vote.default" />
            <argument type="service" id="fos_comment.acl.vote" />
            <argument type="service" id="fos_comment.acl.comment" />
        </service>
    </services>
</container>
