Home  >  Article  >  Backend Development  >  权限管理系统

权限管理系统

WBOY
WBOYOriginal
2016-06-23 14:05:50902browse

现在做一个后台管理系统,不知道如何去分配权限更好。
如:
只有管理员才可以添加新的普通管理员。
普通管理员只能做普通的事。
数据库要如何设计呢?


回复讨论(解决方案)

简单点的:用户表中加一个权限字段,比如rid ,通过rid去判别即可。

这个太简单了,而且不好管理,希望有大牛,可以推荐个方法

必须要有角色表

增加一个权限的字段 ,存放他拥有的操作权限action

然后对每一个action进行匹配,如果存在就可以执行,不存在则不让执行。

Statement:
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