FOSCommentBundle功能包:添加Symfony2内建的ACL安全

  • 原文出处:8-adding_symfony2s_builtin_acl_security.md

  • 原文作者:FriendsOfSymfony

  • 授权许可:创作共用协议

  • 翻译人员:FireHare

  • 校对人员:

  • 适用版本:FOSCommentBundle 2.0.5

  • 文章状态:草译阶段

Step 8: Adding ACL security

Note:

注意:

This bundle ships with support different security setups. You can also have a look at Adding role based ACL security.

本功能包支持不同的安全设置。您也可以查看基于ACL安全添加角色

To use the built in Acl system, it must first be initialised with the Symfony2 console:

要使用内建的ACL系统,首先需要使用Symfony2命令行进行初始化:

$ app/console init:acl

Additionally, your configuration needs to be modified to add the right managers:

另外,您的配置需要添加权限管理器:

# app/config/config.yml
fos_comment:
    acl: true
    service:
        manager:
            thread:  fos_comment.manager.thread.acl
            comment: fos_comment.manager.comment.acl
            vote:    fos_comment.manager.vote.acl


Note:

注意:

Note: you must enable the Security Acl component::

注意您必须启用安全ACL组件

# app/config/security.yml
security:
    # ...
    acl:
        connection: default


Finally, you must populate the Acl system with entries that may not be there yet by running:

最终,您必须通过运行下列语句来填充ACL系统可能不存在的条目:

$ app/console fos:comment:installAces


This will make sure that the Acl entries in the database are correct. This comment must be run whenever any configuration for security changes in FOSCommentBundle,including enabling the security features or changing the FQCN of your extended FOSCommentBundle objects.

这将确保在数据库中的ACL条目是正确的。在FOSCommentBundle功能包中无论何时进行了安全配置的改变,都必须运行一次该命令,包括启用安全特性或改变您扩展FOSCommentBundle对象的FQCN。

That is it!

Return to the index.

返回到指南索引页。


你可能感兴趣的:(Bundle,symfony2,添加ACL安全,功能包)