在CMS网站中,我们常常需要给不同的角色分配不同的浏览权限。在drupal7中,采用分类权限控制法就可以实现此功能。比如:我们设置了“分公司领导”、“分公司中层”、和“分公司员工”等角色,在分类词汇“分享对象”中设置“分公司领导”、“分公司中层”、“分公司员工”等。如果我们希望角色“分公司领导”可以浏览上述全部内容,角色“分公司中层”可以浏览“分公司中层”和“分公司员工”分类的内容,角色“分公司员工”只能浏览“分公司员工”分类的内容。下面介绍具体的实现方法。

1、安装Taxonomy Access Control模块并启用。
2、点击配置》用户》Taxonomy Access Control。
3、编辑匿名用户和注册用户的角色权限。

勾选Global下面的default选框,查看、更新、删除选项都选“D”,Add Tag、View Tag 不勾选。保存。

4、设置“分公司领导”、“分公司中层”、“分公司员工”角色为可编辑状态。

编辑“分公司领导”角色的权限:

设置好分享对象“分公司领导”的相应权限后,再依次增加分享对象“分公司中层”和“分公司员工”并设置好相应的权限。

至此,完成了角色“分公司领导”的分类访问授权。如果登录用户的角色是“分公司领导”,那么他就可以浏览“分公司领导”、“分公司中层”、“分公司员工”三个分类下面的内容了。

其他角色的分类权限设置照此办理。

5、应用案例

在新增文章时,选择相应的分享对象,文章保存后,会有分享对象的术语列示,点击可链接到相关分类的页面列表。当然,对无权用户,这个标签和链接都是不可见的。假如用户不属于“分公司领导”角色,新建一篇文章,选择“分享对象”为“分公司领导”:

以用户hyh登录。用户hyh属于“分公司领导”角色。那么他可以看到这篇文章和相应的分类标签:

点击“分享对象”下的“分公司领导”链接,就可以浏览“分公司领导”分类下的文章列表:

现在以“gechene”用户登录。因为““gechene”不属于“分公司领导”角色,他看不到上面的页面。

6、下面是Taxonomy Access Control 的英文用法说明。

Using the Taxonomy Access Control Module

Here's the example we're going to use in this tutorial.
  • On this screen we have 5 content items, all of the same content type.
  • Each content item is tagged with the appropriate state. For example, San Francisco is tagged with "California".
  • We want to deny anonymous users the ability to view items from some states.

Here's how we use Taxonomy Access Control to solve this problem.
  • Install and enable Taxonomy Access Control: http://drupal.org/project/taxonomy_access

  • Install the Taxonomy Access Control module: http://drupal.org/project/taxonomy_access
  • Enable the module.
  • Click the Rebuild permissions button.

  • You'll see a message saying, The content access permissions have been rebuilt.
  • Go to Configuration > Taxonomy Access Control.
  • You'll see that you have options for each user role. Click "edit access" rules next to anonymous user.

You'll now see the main Taxonomy Access Control page. Here's how to understand the page:

  • You add the tags on the left.
  • You look for the permissions across the top.

First, let's add the tags:

  • Under New, choose a tag.
  • Click Add.
  • Repeat until you've chosen all the tags that you want to control access for.

Now let's look across the top of the page:
Here are 5 new permissions that Drupal doesn't have by default:
  • View: can the user see nodes with this term?
  • Update: can the user edit node with this term?
  • Delete: can the user delete nodes with this term?
  • Add: can the user add this term to a node?
  • View: can the user see the term when looking at a node?

Now that we've seen both the left and the top of the page, we can start to apply permissions.

For each permssion, you choose the setting for each tag. Here's what the labels A, I, D mean:

  • A: people in this user role (in this case, anonymous) have this permission (in this case, View)
  • I: people in this user role have the same permissions as the default setting above
  • D: people in this user role do not have this permission.

So, if we the permissions as in the image below, anonymous users can view content tagged with Texas and Washington but they can't view content tagged with California or Georgia.

Look back up to the image at the start of this tutorial. Here's how that screen now appears to anonymous users.

drupal7分类权限控制方法相关推荐

  1. linux进入节点权限,一种基于索引节点的Linux访问权限控制方法与流程

    本发明涉及计算机领域,尤其涉及一种基于索引节点的Linux访问权限控制方法. 背景技术: 传统的Linux访问控制方式是DAC(Discretionary Access Control,自主访问控制) ...

  2. shiro 方法级别细粒度权限控制_乐逗游戏申请专利:一种工作流节点的权限控制方法...

    求助:如果您是小公司.小团队.个人遇到违法裁员,需要司法援助,可以联系文末微信 援助:如果您是律师.律师事务所,愿意伸手援助,可以联系文末微信. 6月25日,本纪(微信公众号:Truedad)获悉.深 ...

  3. java web常用权限方式,java web项目的几种权限控制方法

    一.spring boot项目,使用@Configuration注入WebMvcConfigurer来实现拦截器 如: @Configuration public class HighersoftWe ...

  4. SAP License 数据安全: SAP 权限的特殊控制方法

    SAP系统内的权限管理是以"角色/Role"这一概念展开的,一个"角色/Role"上分配了体现权限的一组"事务代码/T-Code"和体现限制 ...

  5. 数据库实验-实验二-用户权限管理

    一.实验目的 1. 对ORACLE数据库系统的用户权限管理有感性认识. 2. 事务是由用户定义的一个数据库的操作序列,这些操作要么全做,要么全不做,是一个不可分割的工作单位. Oracle数据库使用事 ...

  6. 在linux上备份文件夹在哪里找,Linux 备份 文件夹的权限 然后在其他机器进行恢复...

    Study From https://www.cnblogs.com/chenshoubiao/p/4780987.html 用到的命令 getfacl 和 setfacl 备份 getfacl -R ...

  7. RBAC新解 - 基于资源的权限管理

    1.什么是角色 当说到程序的权限管理时,人们往往想到角色这一概念.角色是代表一系列可执行的操作或责任的实体,用于限定你在软件系统中能做什么.不能做什么.用户帐号往往与角色相关联,因此,一个用户在软件系 ...

  8. [转]asp.net权限认证:HTTP基本认证(http basic)

    本文转自:http://www.cnblogs.com/lanxiaoke/p/6353955.html HTTP基本认证示意图 HTTP基本认证,即http basic认证. 客户端向服务端发送一个 ...

  9. web安全编程——权限的分配和控制

    web安全编程--权限的分配和控制 2009-07-02 15:46 通常权限划分是为了控制数据和功能的使用范围.传统的划分方法一般将用户划分为匿名用户.普通登录用户.管理员用户.我们暂时将以上三 种 ...

最新文章

  1. python循环最简单的解释_python循环-通往简洁的必经之路
  2. 【学习笔记】无向图、有向图的三元环、四元环计数问题(根号分支+bitset)
  3. 用JQUERY为INPUT的TXT类型赋值及取值操作
  4. 设计师必备|年年都能借鉴的新年Banner设计
  5. 数据:以太坊2.0合约质押新增7.47万ETH
  6. PHPmail 亲测可用
  7. 国庆在家太无聊, 用Java爬了上千张小姐姐照片...
  8. 螺旋数组,之字形数组
  9. Python unittest discover()方法与执行顺序补充
  10. BackTrack 4 R2安装VMware tools
  11. 曲奇云盘资源搜索引擎_曲奇云盘下载-曲奇云盘官网版v3.2.4-sosyes
  12. SPI - 相关类型及其扩展
  13. Jquery 禁止键盘Backspace键
  14. threejs + 3dmax 烘培模型展示效果
  15. html和php网站哪个好,HTML和PHP网站设计实例
  16. 【更新】京东、美团、饿了么获取cookies
  17. 2022-2028全球与中国智能家居解决方案市场现状及未来发展趋势
  18. Packstack搭建Openstack R版本
  19. 如何利用积分系统提升社群活跃度与留存率?
  20. excel(排序、合并单元格、合并后求和)

热门文章

  1. Java导出excel并下载功能
  2. GIS与地质灾害评价——坡度分析
  3. Linux高级运维 第八章 部署docker容器虚拟化平台
  4. 大数据成互联网必争之地 迅雷布局抢先机
  5. BugKu-Misc-赛博朋克
  6. Windows下Apache Tomcat?的下载安装和使用
  7. 【英语复试】-问答总结+前沿关键词
  8. 汽车驾驶盲区 无论新手老手都要看看
  9. TCPUDP 常见的错误码
  10. MySQL 字符集 注意事项