`
cjc
  • 浏览: 658302 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

OpenJWeb快速开发平台组织结构权限继承变更说明

阅读更多

原来的组织结构权限继承设置为,当下级部门拥有某权限时,则上级部门拥有这个权限.但感觉不太合理,因为一个部门角色众多,例如给下级部门的系统管理员一个admin权限,上级部门的人员不应该所有角色都得到这个权限,这样做也是很危险的.

现在改为这种方式:

在部门下建立角色树,角色树具有权限继承关系,即上级角色可以获得下级的角色权限,这样比较合理,部门不能获得部门下面的角色的权限,但部门节点的权限可以被本部门全体人员共用,只是部门权限不具有继承性.

与角色类似,如果岗位,职位权限要实现继承的话,与角色的实现方式相同,下面是角色权限继承的sql语句:

create or replace view v_user_auth as
select a.user_id,a.login_id,b.comm_code,b.auth_name,b.auth_resource from
comm_user a,comm_auth b ,comm_user_auth c
where c.user_id = a.user_id
and c.auth_id = b.auth_id
union
select a.user_id,a.login_id,b.comm_code,b.auth_name,b.auth_resource from
comm_user a,comm_auth b , comm_user_role d,comm_role_auth e
where a.user_id = d.user_id
and d.role_id = e.role_id
and e.auth_id = b.auth_id

union


select a.user_id,a.login_id,b.comm_code,b.auth_name,b.auth_resource from (
select a.user_id,a.login_id,b.row_id row_id,b.tree_code,b.org_type from comm_user a,comm_dept b where a.dept_id=b.pk_id union
select a.user_id,c.login_id,a.org_id row_id,b.tree_code,b.org_type from comm_org_emp_rel a,comm_dept b,comm_user c where b.row_id = a.org_id
and c.user_id=a.user_id) a,
(
select a.dept_id,c.auth_id,b.tree_code,c.comm_code ,c.auth_name,c.auth_resource,b.org_type,b.row_id from comm_dept_auth a,comm_dept b,comm_auth c where a.dept_id =b.row_id
and a.auth_id=c.auth_id) b
where ((b.tree_code like a.tree_code ||'%' and b.org_type in ('ROLES')) --如果是角色类型的组织结构节点,则继承
and a.org_type in ('ROLES'))
or b.row_id = a.row_id --行政部门关联

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics