It's all about the answers!

Ask a question

How to check access to a work item ?

Sudipto Sarkar (631443) | asked Jun 15 '16, 2:47 a.m.
edited Jun 15 '16, 3:08 a.m. by Ralph Schoon (63.2k33646)
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
                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?

One answer

permanent link
Ralph Schoon (63.2k33646) | answered Jun 15 '16, 3:14 a.m.
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.

explain the attachments API

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.