原來(lái)的組織結(jié)構(gòu)權(quán)限繼承設(shè)置為,當(dāng)下級(jí)部門擁有某權(quán)限時(shí),則上級(jí)部門擁有這個(gè)權(quán)限.但感覺不太合理,因?yàn)橐粋€(gè)部門角色眾多,例如給下級(jí)部門的系統(tǒng)管理員一個(gè)admin權(quán)限,上級(jí)部門的人員不應(yīng)該所有角色都得到這個(gè)權(quán)限,這樣做也是很危險(xiǎn)的.
現(xiàn)在改為這種方式:
在部門下建立角色樹,角色樹具有權(quán)限繼承關(guān)系,即上級(jí)角色可以獲得下級(jí)的角色權(quán)限,這樣比較合理,部門不能獲得部門下面的角色的權(quán)限,但部門節(jié)點(diǎn)的權(quán)限可以被本部門全體人員共用,只是部門權(quán)限不具有繼承性.
??? 與角色類似,如果崗位,職位權(quán)限要實(shí)現(xiàn)繼承的話,與角色的實(shí)現(xiàn)方式相同,下面是角色權(quán)限繼承的sql語(yǔ)句:
?
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')) --如果是角色類型的組織結(jié)構(gòu)節(jié)點(diǎn),則繼承
and a.org_type in ('ROLES'))
or b.row_id =? a.row_id --行政部門關(guān)聯(lián)
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

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