It's all about the answers!

Ask a question

Find Permissions Assigned to a Role using Client Side Java API


Arun Batra (14612427) | asked Nov 17 '15, 6:01 a.m.
I am looking for a way to extract permission information about Project area roles and the team area roles.
Is there a way to find this out?
If not a direct way? Then is there a way to retrieve the full project process configuration source in the API so that I may just parse it and get get this detail?

Regards,
Arun Batra

Comments
1
Ralph Schoon commented Nov 17 '15, 8:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I haven't done this. You can try IProcessClientService.getClientProcess(projectArea,monitor).getPermittedActions(processArea, operationId, actions, monitor) and go ahead from there.

Accepted answer


permanent link
Arun Batra (14612427) | answered Dec 01 '15, 1:15 a.m.
Thank you Ralph for your comment. As per the javadocs, the above only provides the permitted actions for the "logged in user". However I am looking for all the permissions assigned to each role in a Project and to all the users in it. I worked it out by extracting the process configuration source and reading the XML to find all the information I needed. Roles>PermissionIds>ActionIds. However I had to keep create a separate mapping file to store the relation of the permission/action Ids and their names.

IContentManager icm = teamRepository.contentManager();
Map pd = projectArea.getProcessData();
projectContent = (IContent) pd.get(ProcessContentKeys.PROCESS_SPECIFICATION_KEY);   
teamContent = (IContent) pd.get(ProcessContentKeys.PROCESS_CUSTOMIZATION_KEY);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
icm.retrieveContent(<team/project_content>, stream, null);   
String contentString = new String(stream.toByteArray(), content.getCharacterEncoding());
Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented Dec 01 '15, 4:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Nice. Other questions in this area indicate that there is no easy answer, so your approach might be the only valid way.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.