9 Replies Latest reply on Apr 20, 2017 5:07 AM by supandey RSS
    orhand Explorer

    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);