-----用戶對應的權限菜單----------------------------------------------------------------------------------------
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