包含其他组的 Cognos 组

Cognos group that contains other group

提问人:Samuele 提问时间:9/8/2023 更新时间:9/12/2023 访问量:20

问:

我需要从内容存储及其父级中提取 cognos 组。我已经找到了查询,但如果一个组包含其他组,则它不起作用。我试过 MotioPi 但它没有显示我需要的信息

塞缪尔

我的查询:

with RecursiveCTE
as(
SELECT 
          cmobjnames.cmid as object_id,
          cmobjnames.name objnames,
          CAST(cmobjnames.name AS VARCHAR(MAX)) AS TreePath,
          cmobjects.PCMID as parent_id          
   FROM   cmobjnames           
          INNER JOIN cmobjects
                     ON cmobjnames.cmid = cmobjects.cmid
        where cmobjnames.cmid=104 -- id membro padre directory Cognos
        and cmobjnames.ISDEFAULT=1
 UNION ALL
 SELECT 
          cmobjnames.cmid as object_id,
           cmobjnames.name objnames,
           CAST(H.TreePath + '\'
         + CAST(cmobjnames.name AS VARCHAR(100)) AS VARCHAR(MAX)) as TreePath,
           cmobjects.PCMID as parent_id          
   FROM   cmobjnames           
          INNER JOIN cmobjects
                     ON cmobjnames.cmid = cmobjects.cmid
          INNER JOIN RecursiveCTE H
          ON H.object_id =cmobjects.PCMID
        where  cmobjects.classid IN ( 54,8,26) -- seleziono folder , gruppi, ruoli
        and cmobjnames.ISDEFAULT=1
)       
 SELECT objnames as Name
 , object_id
 , parent_id 
 , TreePath
FROM RecursiveCTE
INNER JOIN cmobjects
 ON object_id = cmobjects.cmid
 where cmobjects.classid IN ( 54,26) -- seleziono  gruppi, ruoli
Cognos

评论


答:

0赞 dougp 9/9/2023 #1

免責聲明:

既不支持也不建议对 Content Store 数据库进行黑客攻击。如果出现问题,IBM 和我都不会帮助您。使用此信息的风险由您自行承担。

假设:

  • 您询问的是 Cognos 组,而不是外部目录提供程序(如 Active Directory)中的安全组。
  • 您使用的是 SQL Server。

“父母”不是正确的词。角色和组成员身份通过CMREFORD1中定义的对象关系进行记录。

with
objname as (
  select o.CMID
  , coalesce(n2.name, n.NAME) as 'NAME'
  from CMOBJECTS o
    left outer join CMOBJNAMES n on n.CMID = o.CMID
                           and n.LOCALEID = 92
    left outer join CMOBJNAMES n2 on n2.CMID = o.CMID
                           and n2.LOCALEID = 118
)

select MemberName.NAME as 'Member'
, GroupName.NAME as 'Group'

from         CMOBJECTS MemberObject
  inner join objname MemberName on MemberName.CMID = MemberObject.CMID
  inner join CMCLASSES MemberClass on MemberClass.CLASSID = MemberObject.CLASSID
  inner join CMREFORD1 r on r.REFCMID = MemberObject.CMID
  inner join CMOBJECTS GroupObject on GroupObject.CMID = r.CMID
  inner join objname GroupName on GroupName.CMID = GroupObject.CMID

where MemberClass.NAME = 'group'
  and MemberName.NAME = 'All Authenticated Users'