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

How to get the permissions set on a user programmatically(serverside)

Hi

I am trying to check the permissions on a user .If the user has a permission to create workitem in a project area or not. Is there a way to get this information once I have the contributer handle. For eg:

I have the the following to get the contributer

IRepositoryItemService item = getService(IRepositoryItemService.class);
        IContributorHandle approver = getAuthenticatedContributor();
        IItem username = item.fetchItem(approver, null);
        IContributor contributor = (IContributor)username.getFullState();
        return contributor.getName();

So once I get the contributer I need to check whether this user has permission to create and save workitem on a particular project area. I do not know whether there is any API functions which support this operation.

Appreciate your help.

0 votes


Accepted answer

Permanent link
The permissions are not tied to the user, but to the role the user has. The permissions are also not stored with the user but in some other process related API. See for how to at least get the roles of a user. http://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/
Meera Varma selected this answer as the correct answer

1 vote


2 other answers

Permanent link
Hi Meera,
I don't have personal experience with this, but the following forum post has some suggestions:  https://jazz.net/forum/questions/28417/web-client-api-to-know-the-permissions-of-the-logged-in-user

1 vote


Permanent link
Old post, but still might be useful to someone out there.

If you have the IRole object, you can send the actions as a string array:
String[] actions = {"modify","any","create","delete"}; //<- not sure if this encompass all the actions available.

to the process service (using client side libraries here):
boolean[] actionsAllowed = processService.getPermittedActions(role.getId(), actions, monitor);

and you'll get true or false, depending if the current role has those actions. Haven't tested this, though.

0 votes

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,943

Question asked: Jan 16 '13, 6:22 a.m.

Question was seen: 6,960 times

Last updated: Jan 14 '15, 12:59 p.m.

Confirmation Cancel Confirm