Home > Database > Mysql Tutorial > 权限控制的相关思路_MySQL

权限控制的相关思路_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:50:58
Original
1008 people have browsed it

bitsCN.com

从上图开始分析,关于权限我们可以从两方面入手,一是从员工方面权限,二是角色方面的权限。举个例子吧,张三他是甲公司的员工,因此他就有一个员工的权限;同时他也是该公司的项目经理,所以,他也拥有项目经理这个角色的权限。因此,在真正获取张三的权限时应是员工权限与角色权限的并集。

SQL语句可以这样写:
select func_code,func_name from func_dic where func_code in
(
select func_code from mdsp_role_func_alloc where role_id in
(
select role_id from mdsp_user_role where staff_id =
(
select staff_id from staff where login_name=''
)))

union
select func_code,func_name from func_dic where func_code in
(
select func_code from MDSP_USER_FUNC_ALLOC where staff_id =
(
select staff_id from staff where login_name=''
))

bitsCN.com
Related labels:
yes
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