Add Roles to admin account using metservlet caller

Four Stars

Add Roles to admin account using metservlet caller

Hi ,

I have a requirement to add Operation manger role to default admin account using metaservlet.

I have gone through the sample metaservlet call, but could not find any way to update the user roles.

 

I tried using 

{
"actionName": "setRoleLimitation",
"authPass": "admin",
"authUser": "admin@company.com",
"limitation": true,
"rightKey": "JOB_CONDUCTOR_MANAGMENT,SERVERS_MANAGMENT, AUDIT_MANAGMENT, SOA_MANAGMENT, DASH_SOA_MANAGMENT,DASH_CONNECTIONS,DASH_JOBS,COMMANDLINE_MANAGMENT",
"userRole": "Operation Manager"
}

 

but getting below error not sure how to get it working

{"error":"No enum constant org.talend.gwtadministrator.client.global.menu.RoleProvider.Roles.Operation Manager","returnCode":1}

 

Thanks,

Amit Kumar


Accepted Solutions
Employee

Re: Add Roles to admin account using metservlet caller

Basically, this is changing the rights on a role.  In the example below, you are saying that DESIGNER_ROLE will have SERVERS_READ rights turn off (i.e. restricted).  If you set limitation to false, then it means the rights is not restricted, hence allowed.  This change the rights assign to the role, which will change for all users assigned to that role. The username and password in the parameters is just for metaservlet to authenticate through TAC to call the action.  This user should have the Administrator role.

 

{
  "actionName": "setRoleLimitation",
  "authPass": "admin",
  "authUser": "admin@company.com",
  "limitation": true,
  "rightKey": "SERVERS_READ",
  "userRole": "DESIGNER_ROLE"
}

 


All Replies
Moderator

Re: Add Roles to admin account using metservlet caller

Hello,

Could you please indicate on which build version you got this issue?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars pne
Four Stars

Re: Add Roles to admin account using metservlet caller

Amazing , no reply from support (Sabrina)
But still ask you to give kudos ... :-( :-(
I have the same problem ... but can't find an answer
Employee

Re: Add Roles to admin account using metservlet caller

Per the documentation https://help.talend.com/reader/XKiHN_uvNCRjt1~QcNn4fw/URmRoWm7YAuFC06smWxO9g, the value for the userRole parameter should be:  

OPERATION_MANAGER_ROLE

 

Four Stars pne
Four Stars

Re: Add Roles to admin account using metservlet caller

Thanks for your help,

But it's still not working ... and it's not easy to understand the "rightKey" field. 

how to use the rightKey and userRole fields together ???? 

Documentation isn't clear enough.

Employee

Re: Add Roles to admin account using metservlet caller

Basically, this is changing the rights on a role.  In the example below, you are saying that DESIGNER_ROLE will have SERVERS_READ rights turn off (i.e. restricted).  If you set limitation to false, then it means the rights is not restricted, hence allowed.  This change the rights assign to the role, which will change for all users assigned to that role. The username and password in the parameters is just for metaservlet to authenticate through TAC to call the action.  This user should have the Administrator role.

 

{
  "actionName": "setRoleLimitation",
  "authPass": "admin",
  "authUser": "admin@company.com",
  "limitation": true,
  "rightKey": "SERVERS_READ",
  "userRole": "DESIGNER_ROLE"
}

 

Four Stars pne
Four Stars

Re: Add Roles to admin account using metservlet caller

Hello,

 

Thank you for your help.

 

Four Stars

Re: Add Roles to admin account using metservlet caller

Hi,
The solution is to create a new admin account with extended previledges.
So that you can perform the required task.
Once done you can retain new user or delete it based on requirement.
Four Stars

Re: Add Roles to admin account using metservlet caller

I followed the above as was in crunch to get it done.
Four Stars pne
Four Stars

Re: Add Roles to admin account using metservlet caller

Hi Kamit_sr,

Much better and easier to do. My neurons are tired of searching and understanding some metaservlet commands :-(

Thanks