CSSDK - List the groups a user is a member of
I can't seem to find a way to list the groups which a user is a member of. I see you can list all users, you can list all groups and users within, but I cannot seem to figure out how to iterate through all the users and then get the specific groups that each individual user belongs to.
I'm using both TS 16.4 & TS 20.2.
Thanks,
Tim
Tagged:
0
Comments
-
I believe I get this working by using getParentGroups:
CSPrincipalManager principalManager = client.getPrincipalManager(); CSIterator usersIterator = client.getPrincipalManager().getAllTSUsers(); while (usersIterator.hasNext()) { CSUser someUser = (CSUser) usersIterator.next(); System.out.println("*** user: " + someUser.getName()); CSIterator groupIterator = someUser.getParentGroups(false); CSGroup group = null; while( groupIterator.hasNext() ) { group = (CSGroup) groupIterator.next(); if (group.getKind() == 0 && !"iwEveryone".equals(group.getName())) { System.out.println("group: " + group.getName()); } } }
1
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 149 General Questions
- 148 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 181 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories
TeamSite Developer Resources
If you are interested in gaining full access to the content, you can register for a My Support account here.
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.