Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi, I need to set run time permission for specific service(eg. ChangePassword() ) to particular users.
I tried using AddRunTimePermission() but I am getting invalid service name error.
Users[testUser].AddRunTimePermission({
allow: true /* BOOLEAN */ ,
principal: testUser/* STRING */ ,
resource: "ChangePassword" /* STRING */ ,
type: "ServiceExecute" /* STRING */ ,
principalType: "User" /* STRING */
});
err : 36JavaException: java.lang.Exception: Invalid Permission Type : [ServiceExecute]
Solved! Go to Solution.
Hi All,
the correct code for enabling permission to particular code :
Users[username].AddRunTimePermission({
allow: true /* BOOLEAN */ ,
principal: username /* STRING */ ,
resource: "your service name 1, your service name 2" /* STRING */ ,
type: "permission type" /* STRING */ ,
principalType: "User" /* STRING */
});
Got answers by myself, hope this will be helpful for others too...
Hi All,
the correct code for enabling permission to particular code :
Users[username].AddRunTimePermission({
allow: true /* BOOLEAN */ ,
principal: username /* STRING */ ,
resource: "your service name 1, your service name 2" /* STRING */ ,
type: "permission type" /* STRING */ ,
principalType: "User" /* STRING */
});
Got answers by myself, hope this will be helpful for others too...