权限ACL or RBAC?

WBOY
Release: 2016-06-06 20:24:04
Original
1226 people have browsed it

通过对每一个link的赋予一个权限的ID,当拥有此id的时候,则表示可以访问,这种权限叫ACL麽?
还是什么都不是呢?

越来越迷糊了~~求解释。最好详细一点。

回复内容:

通过对每一个link的赋予一个权限的ID,当拥有此id的时候,则表示可以访问,这种权限叫ACL麽?
还是什么都不是呢?

越来越迷糊了~~求解释。最好详细一点。

你这个是简单的过滤,好比登陆的时候带着token,没有token就跳转到登陆页一样。
而ACL是一种访问控制机制,用户直接和权限挂钩。这个比较优秀的是zend framework框架的acl类。
RBAC是基于角色的访问控制,用户只和角色关联,角色可以拥有不同的权限。
拿thinkphp做例子,rbac有基本的五张表:think_user (用户表),think_role (用户分组表),think_node (操作节点),think_role_user (用户和用户分组的对应),think_access (各个操作和用户组的对应)。
网上这个例子的代码比较多,最简单粗暴的就是你走一遍这个流程就能理清关联关系了,把最基本的关联关系理清了,再复杂的权限系统也就这么回事儿了,无非就是表关联。

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!