It's all about the answers!

Ask a question

How to check access to a work item ?

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