Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Find Permissions Assigned to a Role using Client Side Java API

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

0 votes

Comments

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

1 vote


Accepted answer

Permanent link
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

1 vote

Comments

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,955

Question asked: Nov 17 '15, 6:01 a.m.

Question was seen: 3,039 times

Last updated: Dec 01 '15, 4:11 a.m.

Confirmation Cancel Confirm