Here is the DQL to query the list of groups a user belongs to:
select group_name from dm_group where any i_all_users_names = ‘<user id>’;
This gives the list of all groups a user belongs to directly or indirectly.
i_all_users_names is a computed value.
If you want to query for list of groups the logged in user belongs to:
select group_name from dm_group where any i_all_users_names = USER ;
The USER is a place holder for the current logged in User.
Querying for ‘users_names’ attribute instead of i_all_users_names will return only the groups where the user is directly part of that group (no sub groups)
Advertisements