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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Cannot add Runtime and Design permission to dashboard

fmanniti
9-Granite

Cannot add Runtime and Design permission to dashboard

Hello, I'm trying to create a dashboard through JS but I'm having some issues in adding permissions.

That's the code:

try{

    var idDash = Resources["DashboardFunctions"].CreateDashboard({title: "test"});

    Dashboards[idDash].AddRunTimePermission({principal: configurator, allow: true, resource: '*', type: 'PropertyRead', principalType: 'User'});

    Dashboards[idDash].AddRunTimePermission({principal: configurator, allow: true, resource: '*', type: 'PropertyWrite', principalType: 'User'});

    Dashboards[idDash].AddRunTimePermission({principal: configurator, allow: true, resource: '*', type: 'ServiceInvoke', principalType: 'User'});

 

    Dashboards[idDash].AddDesignTimePermission({principal: configurator, allow: true, type: 'Create', principalType: 'User'});

    Dashboards[idDash].AddDesignTimePermission({principal: configurator, allow: true, type: 'Read', principalType: 'User'});

    Dashboards[idDash].AddDesignTimePermission({principal: configurator, allow: true, type: 'Delete', principalType: 'User'});

    result = idDash;

}catch(err){

    result = err.message;

}

This is the error I get:

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

Can you tell me what's wrong?

My TW version is ThingWorx 8.0.0-b11

1 REPLY 1

Hi Fabio Manniti ,

There are no Properties to be used in Runtime permissions. This means we cannot grant run time permission related to Properties. It seems that we can only use the AddRunTimePermission that can grant Service execution permission only. So the error would be backed up since there are no properties permissions. This would work by design.

thanks,

Ciprian

Top Tags