本文共 1652 字,大约阅读时间需要 5 分钟。
原文出处:
原文作者:
授权许可:
翻译人员:FireHare
校对人员:
适用版本:FOSCommentBundle 2.0.5
文章状态:草译阶段
Note:
注意:
This bundle ships with support different security setups. You can also have a look at .
本功能包支持不同的安全设置。您也可以查看
CommentBundle also provides the ability to configure permissions based on the roles a specific user has. See the configuration example below for how to customise the default roles used for permissions.
CommentBundle也可以基于某个特定用户角色来配置权限。参见下面的配置示例,看看如何使用缺省的角色来自定义权限。
To configure Role based security override the Acl services:
要配置基于角色的安全需要覆盖ACL服务:
# app/config/config.ymlfos_comment: acl: true service: acl: thread: fos_comment.acl.thread.roles comment: fos_comment.acl.comment.roles vote: fos_comment.acl.vote.roles manager: thread: fos_comment.manager.thread.acl comment: fos_comment.manager.comment.acl vote: fos_comment.manager.vote.acl
To change the roles required for specific actions, modify the acl_roles
configuration key:
要为特定操作改变要求的角色,需要修改 acl_roles
配置项:
# app/config/config.ymlfos_comment: acl_roles: comment: create: IS_AUTHENTICATED_ANONYMOUSLY view: IS_AUTHENTICATED_ANONYMOUSLY edit: ROLE_ADMIN delete: ROLE_ADMIN thread: create: IS_AUTHENTICATED_ANONYMOUSLY view: IS_AUTHENTICATED_ANONYMOUSLY edit: ROLE_ADMIN delete: ROLE_ADMIN vote: create: IS_AUTHENTICATED_ANONYMOUSLY view: IS_AUTHENTICATED_ANONYMOUSLY edit: ROLE_ADMIN delete: ROLE_ADMIN
转载地址:http://wjffx.baihongyu.com/