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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

how to set RUNTIMEPERMISSION for specific service?

sabharees
13-Aquamarine

how to set RUNTIMEPERMISSION for specific service?

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]

1 ACCEPTED SOLUTION

Accepted Solutions
sabharees
13-Aquamarine
(To:sabharees)

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... 

View solution in original post

1 REPLY 1
sabharees
13-Aquamarine
(To:sabharees)

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... 

Top Tags