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

How to check access to a work item ?

Hi All,
Say that I am accessing a workitem w1. Description field of w1 mentions one attachment say attachment 100.
And say I do not have access to this attachment. How do I detect it ?

I have fetched attachment handle and reached following stage:

IAttachmentHandle attachHandle = (IAttachmentHandle) iReference.resolve();
                IAuditableClient auditableClient = (IAuditableClient) teamRepo
                        .getClientLibrary(IAuditableClient.class);
                IAttachment attachment = (IAttachment) auditableClient
                        .resolveAuditable((IAttachmentHandle) attachHandle, IAttachment.DEFAULT_PROFILE, null);


The highlighted line above throws me an exception as I don not have access to it. I want to detect the access rights. How can I do it?


0 votes



One answer

Permanent link
I am not aware of fine grained read access permissions for work item attachments. If you have access to the work item, you have access to the attachments. There is a permission aware API to resolve handles you could use if in doubt.

https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/
and
https://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/

explain the attachments API

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

Question asked: Jun 15 '16, 2:47 a.m.

Question was seen: 1,815 times

Last updated: Jun 15 '16, 3:14 a.m.

Confirmation Cancel Confirm