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

Problem Adding Runtime permissions to a ThingTemplate with JS

Newbie

Problem Adding Runtime permissions to a ThingTemplate with JS

I am trying to add runtime permissions to a thingtemplate via javascript but getting an error. What is the proper way of doing this ?

It works when I use AddInstanceRunTimePermission(params) but gives an error for AddRunTimePermission(params) which is required by the application.

The error I get:

Wrapped java.lang.Exception: This entity does not support property permissions Cause: This entity does not support property permissions

Which is weird because it can be set at the composer IDE.


Thanks,


Orhan



var params = {

  principal: "DemoUsers" /* STRING */,

  allow: true /* BOOLEAN */,

  resource: "*" /* STRING */,

  type: "PropertyRead" /* STRING */,

  principalType: "Group" /* STRING */

};

// no return

ThingTemplates["TestThingTemplate_Demo"].AddRunTimePermission(params);

9 REPLIES 9

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

What version of ThingWorx is this? There does not appear to be a syntax error. I want to see if I can reproduce this. Is the Thing Template defined in an extension or on the Platform?

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

I was able to reproduce this on thingworx 7.2.3 B-48

I also verified I can view the permissions using a service, but I can't change them.  I see the same error as posted above.

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

7.1.1 and problem reproduced in 7.2.1 as well. The template is produced on the Platform via Composer ide.

Orhan

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

I just ran the above Javascript successfully in version 7.2.4. I tried for both a group and an individual user, and on a thing template defined on the platform and via extension. It worked in all cases.

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

That is weird. Tried it with 7.3.0-b51 and still getting the error..

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

Orhan, could you please submit a Technical support case for this I can reproduce this on 7.3.1 -b39. Let me know if you don't have access to the support.ptc.com

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

There is already a case for this: PTC Case C13364695 opened a few months back..

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

Orhan Dengiz​ thanks for highlighting this I'll check with the case owner for this.

Re: Problem Adding Runtime permissions to a ThingTemplate with JS

To update this thread there was Jira filed TW-18533 related to the case number mentioned in this thread. R&D has mentioned that this is likely working to specification for the reason it appears that the intent is to grant run time privileges on the instances created from the Template and not on the Template itself. That is why AddInstanceRuntimePermissions works and not the AddRunTimePermission on template itself. As Templates do not hold the actual values, they are there for just defining the metadata.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________