您的位置:首页 > 其它

用户角色管理

2015-12-09 10:42 447 查看
用户角色管理作为每个管理系统所必备的模块,也是每个系统的基础模块。
用户角色管理很多都称作通用权限管理系统,网上有很多角色管理设计方法,个人认为不管那种,能满足自己系统的需求就OK了。
下面是一个用户角色权限设计思路:
<1>不同职责的人员,对于系统操作的权限应该是不同;
<2>可以对“组”进行权限分配;
<3>权限管理系统应该是可扩展的;
<4>满足业务系统中的功能权限


创建用户表: user

uid uname upwd

1 admin 123

2 admin2 123456

3 test test123

4 test2 test1234

5 guest 888888

创建角色表: role

rid rname rtype

3 超级管理员 1

1 管理员 11

2 一般管理员 111

权限表: action

aid aname atype

1 添加权限 insert

2 修改权限 update

3 删除权限 delete

4 查询权限 find

5 审核权限 check

userGroup 用户组表 将 用户表 与角色表 关联

ugid rtype uid

1 1 1

2 1 2

3 11 3

4 11 4

5 111 5

actionGroup 权限组表 将角色表 与 权限表关联

agid rtype atype

1 1 insert

2 1 update

3 1 delete

4 1 find

5 1 check

6 11 insert

7 11 update

8 11 delete

9 11 find

10 111 find

查询出 guest 用户的权限

select atype from actionGroup where rtype=(select rtype from userGroup where uid=(select uid form user where uname='guest'))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: