adding a list of users to global role

Posts: 9
Joined: Tue Mar 20, 2018 3:27 am

adding a list of users to global role

Postby kevin1119 » Fri Jun 01, 2018 5:13 pm

hi, i have a list of ids that i want to add to a global roles. it's painful to manually do it 1 by 1.

in the wiki script, i'm following securityService api to retrieve the target context role, but i don't see any method that returns context role. please help

thanks and regards

Posts: 13
Joined: Wed May 17, 2017 5:08 pm

Re: adding a list of users to global role

Postby dan7777777 » Thu Aug 02, 2018 1:04 pm

Are you wanting to add global roles or project roles? Context roles are project roles. Regardless, since I usually know exactly what roles I am trying to programmatically grant, I usually hard code the role id string and use it as the parameter of the method that grants the roles. For example with project role:
securityService.addContextRoleToUser(userId, "project_user", contextId);

However, if you are talking about retrieving a list of global roles, this method works:
var globals = securityService.getGlobalRoles();

Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: noellede69 and 15 guests