Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Lets say, I have set ThingA, ThingB, ThingC for Runtime Permission for UserA, how do I view the list of Things that has been set as RunTime Permission for this user?
Hi,
I think there is no opportunity to get this information by default. I created a service meeting your requirements.
Notice: To run this service you need a parameter 'User' as input (Type: USERNAME)
var params = {
infoTableName: infoTable1 /* STRING */
};
// result: INFOTABLE
var infoTable1 = Resources["InfoTableFunctions"].CreateInfoTable(params);
var newField = new Object();
newField.name = 'Thingname';
newField.baseType = 'STRING';
infoTable1.AddField(newField);
var newField = new Object();
newField.name = 'User';
newField.baseType = 'STRING';
infoTable1.AddField(newField);
var params = {
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
type: 'Thing' /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: RootEntityList
var infoTable2 = Resources["EntityServices"].GetEntityList(params);
for (i=0;i<infoTable2.length;i++){
// result: INFOTABLE dataShape: Permissions
var infoTable3 = Things[infoTable2.name].GetRunTimePermissions();
for (z=0;z<infoTable3.length;z++){
if(infoTable3
{
var newRow = new Object();
newRow.Thingname = infoTable2.name;
newRow.User = infoTable3
infoTable1.AddRow(newRow);
break;
}
}
}
var result = infoTable1;
Thanks Yannick. I will try and let you know the outcome.