Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: How to get the group names of the user who has logged in .Need to achieve this using Windchill API.

$
0
0

Hi, the challange with this will be, that you can filter all the necessary groups. The result will include all the different role groups. Probably you need to get the repository or the base dn to get the groups you are looking for.

Björn

 

 

        WTPrincipal prince = SessionHelper.manager.getPrincipal();

        logger.debug("prince = " + prince);

        Enumeration e = OrganizationServicesHelper.manager.parentGroups(prince, false);

 

        while (e.hasMoreElements()) {

 

            WTPrincipalReference o = (WTPrincipalReference)e.nextElement();

            WTPrincipal localPrince = o.getPrincipal();

            logger.debug("localPrince = " + localPrince.getClass().getName());

            if (localPrince instanceof WTGroup) {

                WTGroup group = (WTGroup) localPrince;

                logger.debug("Group = " + group.getName());

            }

        }


Viewing all articles
Browse latest Browse all 8876

Trending Articles