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

注意:

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命令行进行初始化:

1
$ app /console  init:acl

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

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

1
2
3
4
5
6
7
8
# 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组件

1
2
3
4
5
# 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系统可能不存在的条目:

1
$ 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.

返回到指南索引页



本文转自 firehare 51CTO博客,原文链接:http://blog.51cto.com/firehare/1259018,如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值