WTGroup API removeMember(wtuser) removes user from all the group
Hello Experts,
I want to remove the user from groups using API .. license groups (e.g. "PTC Creo Data Management and Visualization License") & user created groups (e.g. "Advanced Viewing users") which are in turn added in license group by admin.
Problem statement: I am using below API to get the groups in which user is member, but it is pulling the pseudo groups as well, like output I have provided below.
WTGroup.removeMember(wtUser), Windchill goes and delete all assigned groups and as well as pseduo groups associated to WTUser object. Which might lead to other issues for user.
What is best possible way to remove the user from group which are visible in UI (without removing from pseudo groups)? Does anyone has code snippet which I can reuse?
API:
Enumeration<WTPrincipalReference> groups = OrganizationServicesHelper.manager.parentGroups(wtUser);
OUTPUT:
..
*PRINT getPrincipal .getName() output* PRODUCT MANAGER
*PRINT principalRef.getPrincipalStatusDetails() output* Product Manager (Product - TEST_PRODUCT)
*PRINT getPrincipal .getName() output* PTC PDMLink Module License
*PRINT principalRef.getPrincipalStatusDetails() output* PTC PDMLink Module License (Site)
..

