cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Find all User Groups for a Given User

joetenny
12-Amethyst

Find all User Groups for a Given User

I am trying to figure out an easy way to find all User Groups for a Given User.  I know how to find User Groups for the logged in User, just not for other Users.  Someone had mentioned using a GetGroups service for a specific user but I don't know where that is located in Composer.  Any help here will be appreciated.

ACCEPTED SOLUTION

Accepted Solutions
ashaban
12-Amethyst
(To:joetenny)

You can do that with a service in composer:

 

Create a thing and a new service with EntityList info table as a result;

Input the user name as a string

 

This is the most important line: 

 

// result: INFOTABLE dataShape: "EntityList"
let result = Users["someUser"].GetGroups();

View solution in original post

4 REPLIES 4
ashaban
12-Amethyst
(To:joetenny)

You can do that with a service in composer:

 

Create a thing and a new service with EntityList info table as a result;

Input the user name as a string

 

This is the most important line: 

 

// result: INFOTABLE dataShape: "EntityList"
let result = Users["someUser"].GetGroups();

jensc
17-Peridot
(To:ashaban)

Just a clarification, the "GetGroups" service returns inherited groups as well, not only the groups that the user is actually a member of.

joetenny
12-Amethyst
(To:ashaban)

Thanks.  I am pretty novice at developing inside of ThingWorx.  I started creating a Thing; what Base Thing Template should I use?

You can use a GenericThing thing template.

 

Regards,

Sachin

Announcements


Top Tags