原來的組織結構權限繼承設置為,當下級部門擁有某權限時,則上級部門擁有這個權限.但感覺不太合理,因為一個部門角色眾多,例如給下級部門的系統管理員一個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 --行政部門關聯
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
