Skip to main content

2 replies

15-Moonstone
June 17, 2021

Users["username"].GetGroups() will give you a list of groups that the user belongs. use the list to validate and add accordingly.

17-Peridot
June 17, 2021

You suggesting to write custom service for the organisational units of same organisation?

15-Moonstone
June 17, 2021

Organization drives your visibility and user group drivers your permissions on the entities.

Considering the use case that a user from one organization should not be added to another , Thingworx do not have internal restrictions by itself.

But i am not sure exactly what is the final target. But yes you have to manage through services.

Also you can use below services to check if the user exist in the unit.
var params = {
name: "unitname" /* STRING */,
member: "username" /* STRING */
};

// result: INFOTABLE dataShape: EntityReferenceWithDescription
var result = Organizations["TestOrganization"].GetMember(params);

 

var params = {
name: "unitname" /* STRING */
};

// result: INFOTABLE dataShape: EntityReferenceWithDescription
var result = Organizations["TestOrganization"].GetMembers(params);

Community Manager
July 12, 2021

Hi @AP_9587236

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon