Hi All,
I am trying to apply runtime permissions through a service. The code snippet was working fine in one environment, but when I import the same service in another environment, the permissions are not applying. Specially, all other permissions apply except for EventExecute.
Here is the shared working code snippet:
Working code:
Could anyone suggest why the EventExecute permissions specifically might be failing to apply after the environment transfer? Are there any prerequisite settings for event permissions that might be missing in the environment?
Thanks in advance for the help!
Solved! Go to Solution.
Hi @nmutter ,
Thank you for response. I found the root cause: the EventExcecute Permissions were failing due to a change in json key of the GetInstanceRunTimePermissionsAsJSON() service. It seems the key name has changed from EventExecute to EventInvoke.
Since we have not initiated any platform upgrade, we are quite surprised by this change. If you happen to know anything about this change/upgrade, please share it with us so we can understand what caused this modification.
Not sure. I would assume that the entity already has EventExecute permissions and the JSON object you create by just pushing new element may be 'wrong' in the end? You would need to check expected json object for the as JSON call (I do not know it tbh).
But I would recommend using the "normal" service to set permissions (as they manage the json magic for you in the background ;))
ThingTemplates["BasePlatform"].AddInstanceRunTimePermission({
principal: userGroup /* STRING */,
allow: false /* BOOLEAN */,
resource: "*" /* STRING */,
type: "EventExecute" /* STRING */,
principalType: "Group" /* STRING */
});
Setting ALL permissions via the json seems to scary for me
Hi @nmutter ,
Thank you for response. I found the root cause: the EventExcecute Permissions were failing due to a change in json key of the GetInstanceRunTimePermissionsAsJSON() service. It seems the key name has changed from EventExecute to EventInvoke.
Since we have not initiated any platform upgrade, we are quite surprised by this change. If you happen to know anything about this change/upgrade, please share it with us so we can understand what caused this modification.
