用友U9数据库–用户对应的权限明细查询

—–用户对应的权限菜单—————————————————————————————-
select distinct a.name 组织,y.Name 用户,U.Name 用户组,b.Name 角色名称,d.Name,menuBETrl.DisplayName 菜单名称,
case authorityBE.Opinion when 0 then ‘拒绝’ when 2 then ‘允许’ end as 权限值 from Base_UserOrgRole x
inner join base_role_trl b on x.role=b.id and b.SysMLFlag=’zh-CN’ and b.name<>’导出报表权限’ and b.Name<>’OBA’
inner join base_role roleBE on x.role=roleBE.id
inner join Base_RoleApplication z on x.role=z.role
inner join Base_Application_Trl d on z.application=d.id and d.SysMLFlag=’zh-CN’
inner join base_userorg e on x.userorg=e.id
inner join base_organization_trl a on e.org=a.id
inner join Base_User y on e.[User]=y.id
inner join Base_UserGroup_Trl U on y.UserGroup=U.ID –显示用户组
inner join vw_UBF_Security_Right_Task authorityBE on authorityBE.RoleId = roleBE.ID
inner join UBF_Assemble_Menu menuBE on authorityBE.AuthorityItemId =menuBE.ID
inner join UBF_Assemble_Menu_Trl menuBETrl on menuBETrl.ID = menuBE.ID and menuBETrl.SysMLFlag=’zh-CN’
inner join Base_Application appBE on menuBE.[Application] = appBE.ID
–添加条件–
–where U.Name=’财务组’ and y.Effective_IsEffective=1 and authorityBE.Opinion=2

———————————————————————————————————————
—–用户对应的权限菜单–只显示系统模块—————————————————————————————-
select distinct a.name 组织,y.Name 用户,U.Name 用户组,b.Name 角色名称,d.Name 模块名称,
case authorityBE.Opinion when 0 then ‘拒绝’ when 2 then ‘允许’ end as 权限值 from Base_UserOrgRole x
inner join base_role_trl b on x.role=b.id and b.SysMLFlag=’zh-CN’ and b.name<>’导出报表权限’ and b.Name<>’OBA’
inner join base_role roleBE on x.role=roleBE.id
inner join Base_RoleApplication z on x.role=z.role
inner join Base_Application_Trl d on z.application=d.id and d.SysMLFlag=’zh-CN’
inner join base_userorg e on x.userorg=e.id
inner join base_organization_trl a on e.org=a.id
inner join Base_User y on e.[User]=y.id
inner join Base_UserGroup_Trl U on y.UserGroup=U.ID –显示用户组
inner join vw_UBF_Security_Right_Task authorityBE on authorityBE.RoleId = roleBE.ID
inner join UBF_Assemble_Menu menuBE on authorityBE.AuthorityItemId =menuBE.ID
inner join UBF_Assemble_Menu_Trl menuBETrl on menuBETrl.ID = menuBE.ID and menuBETrl.SysMLFlag=’zh-CN’
inner join Base_Application appBE on menuBE.[Application] = appBE.ID
–添加条件–
–where U.Name=’财务组’ and y.Effective_IsEffective=1 and authorityBE.Opinion=2

发布者

闫 世华

书写生活感悟,分享经验知识!

发表评论

电子邮件地址不会被公开。 必填项已用*标注