查看某权限在哪些组织下分配给了哪些用户
查看某权限(包括直接分配权限和通过角色分配)在哪些组织下分配给了哪些用户(替换权限项别名,即以下sql中的'付款单查看')
SELECT
u.fnumber AS 用户名,
bu.fnumber AS 组织编码,
bu.fname_l2 AS 组织名称,
pm.falias_l2 AS 权限项名称,
pm.flongnumber AS 权限项长编码,
pm.ftype AS 权限类型_10代表有权_20代表禁用
FROM
( SELECT
fuserid,
forgid,
fpermitemid,
fpermtype
FROM
( SELECT
fowner AS fuserid,
forgid,
fpermitemid,
fpermtype
FROM
t_pm_userorgperm
WHERE
fpermitemid = (
SELECT
TOP 1 fid
FROM
t_pm_permitem
WHERE
FALIAS_L2 = '付款单查看'
AND FISLEAF = 1 )
UNION
ALL SELECT
fuserid,
forgid,
fpermitemid,
b.fpermtype
FROM
t_pm_userroleorg a
JOIN
t_pm_roleperm b
ON a.froleid = b.froleid
AND b.FPERMITEMID = (
SELECT
TOP 1 fid
FROM
t_pm_permitem
WHERE
FALIAS_L2 = '付款单查看'
AND FISLEAF = 1
)
)
) s
INNER JOIN
T_pm_user u
ON s.fuserid = u.FID
INNER JOIN
T_pm_permitem pm
ON s.fpermitemid = pm.FID
INNER JOIN
T_org_baseunit bu
ON s.forgid = bu.FID
查看某权限在哪些组织下分配给了哪些用户
本文2024-09-22 22:20:41发表“s-hr cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-shr-125980.html