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

Java extension: How to add run-time instance permissions to a service in java

Highlighted
Regular Member

Java extension: How to add run-time instance permissions to a service in java

Hi,

I'm building a Java extension that creates a Thing Template with services, and a Thing Shape with services.

How can I set run-time instance permissions to the Template and Shape in java?

Thanks,

Isaac

3 REPLIES 3

Re: Java extension: How to add run-time instance permissions to a service in java

Hi Isaac Kaliski​,

Per my understanding; you will have to create a Service which you can run in composer to add the requisite permissions.

Re: Java extension: How to add run-time instance permissions to a service in java

Generally for permissions, set superuser context before and clear after:

thing.AddRunTimePermission("PropertyRead", "*", "myGroup", "Group", true);

          thing.RestartThing();

Note for The Templates, the intent is to grant run time privileges on the instances created from the Template and not on the Template itself. So  AddInstanceRuntimePermissions works and the AddRunTimePermission does not work on template itself. As Templates do not hold the actual values, they are there for just defining the metadata.

Re: Java extension: How to add run-time instance permissions to a service in java

So what you are saying is that there is no way to add permissions in the extension itself. Only after importing the extension the admin needs to do an extra operation to setup permissions?

If the admin needs to do an extra operation to setup the permissions in the Composer, he might setup the permissions directly rather than running manually a service.

Announcements

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