Add Run Time Permissions through script to Thing Templates, Thing Shapes, etc.
Hi,
I am trying to add Run Time permissions to various entities through script using the code snippet below. While I can add Run Time permissions to Things without any problems, I get errors when trying to set the Run Time permissions "PropertyRead", "PropertyWrite", "EventInvoke" and "EventSubscribe" for everything except for Things (i.e. ThingTemplates, ThingShapes, etc.). The error reads: "Execution error in service script MyThing AddPermissionsToThingTemplate] : Wrapped java.lang.Exception: This entity does not support property/event permissions Cause: This entity does not support property/event permissions". Surprisingly, the "ServiceInvoke" permission does not return an error and can be set.
var params = {
principal: "MyGroup",
allow: "true",
resource: "*" ,
type: "PropertyRead",
principalType: "Group"
};
ThingTemplates[thingName].AddRunTimePermission(params);
How can I add Run Time permissions to entities that are not Things, e.g. Thing Templates and Thing Shapes, via script?
I am running ThingWorx 8.0.1-b39.
Thanks

