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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Retrieving associated user groups and roles

JM_10218548
4-Participant

Retrieving associated user groups and roles

How to retrieve all roles/groups a user is associated with - Thingworx. 

ACCEPTED SOLUTION

Accepted Solutions

// For the current user:
let myGroups = Resources["CurrentSessionInfo"].GetCurrentUserGroups();

// For user "alice":
let aliceGroups = Users["alice"].GetGroups();

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:JM_10218548)

I believe if you are in the context of 'current user' there is a GetGroups (Something like CurrentSession functions)

and I think the User object itself also supports something like that, but you may need recursion if not 'current user'

I know at one point there were some upgrades to the security mapping services, and there might be some other OOTB service now that can retrieve this, I unfortunately forget which services were added for that. Maybe start by checking here:

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Composer/Security/Users/AccessReports.html#

 

// For the current user:
let myGroups = Resources["CurrentSessionInfo"].GetCurrentUserGroups();

// For user "alice":
let aliceGroups = Users["alice"].GetGroups();
Announcements


Top Tags