CMDBuild Forum

User - Group view

Hello Community,

Does anyone have a database query that can list (overview) all users and their group memberships?

Kind regards,

Frans Erich

A colleague has found the answer to this question:

SELECT *
FROM public.“User” “US”
LEFT JOIN public."_UserConfig" “UC” ON “UC”.“Owner” = “US”.“Id”
LEFT JOIN public.“Map_UserConfigUser” “UCU” ON “UCU”.“IdObj1” = “US”.“Id”
LEFT JOIN public.“Map_UserRole” “MU” ON “MU”.“IdObj1” = “US”.“Id”
LEFT JOIN public.“Role” “RL” ON “RL”.“Id” = “MU”.“IdObj2”

1 Like
SELECT DISTINCT "User"."User" user_name, "Role"."Code" role_code, "Type" role_type
FROM "User"
  JOIN "Map_UserRole" ON "User"."Id" = "Map_UserRole"."IdObj1"
  JOIN "Role" ON "Map_UserRole"."IdObj2" = "Role"."Id"
1 Like