Skip to main content
15-Moonstone
September 6, 2019
Solved

Unable to add PropertyRead runtime permission into a new template by programming

  • September 6, 2019
  • 2 replies
  • 1365 views

Hi,

 

The system complaints that "This entity does not support property permissions"

 

Exception:

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

 

Here under is a code to simulate the case

 

 

var EntityServices = Resources['EntityServices']
var newTemplateName = 'TestThingTemplate'

if (ThingTemplates[newTemplateName]) EntityServices.DeleteThingTemplate({ name: newTemplateName })

EntityServices.CreateThingTemplate({name: newTemplateName, thingTemplateName: 'RemoteThing' }) ThingTemplates[newTemplateName].AddRunTimePermission({ principalType : "Group", principal : "Users", allow : true, type : "PropertyRead", resource : "*" })

 

 

My Bests,

Hung Tran

 

 

 

Best answer by htran-21

Anyway, the Instance Runtime Permission should be implemented behind the scenes in order to keep the security scheme to be consistent and simple for use.

2 replies

htran-2115-MoonstoneAuthorAnswer
15-Moonstone
September 10, 2019

Anyway, the Instance Runtime Permission should be implemented behind the scenes in order to keep the security scheme to be consistent and simple for use.