Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
In an organization, 3 organizational units were created. All units having individual UserGroups.
The users in one UserGroup should not be added to another UserGroup. How to achieve this?
Users["username"].GetGroups() will give you a list of groups that the user belongs. use the list to validate and add accordingly.
You suggesting to write custom service for the organisational units of same organisation?
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);
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