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,如需转载请自行联系原作者

相关文章
|
10月前
|
前端开发 安全 API
DRF--介绍和安装
DRF--介绍和安装
|
安全 数据安全/隐私保护