It's all about the answers!

Ask a question

pre-condition action: how to read userID


Baris Erdemir (1812819) | asked Mar 04 '11, 7:20 a.m.
Hi,
I am developing a pre-condition and extending AbstractService, implementing IOperationAdvisor.
I am binding the pre-condition to work item save operation.
Is it possible to read connected users ID?
If yes, Can you please provide appropriate APIs?
Thanks,

One answer



permanent link
Eduardo Bello (4401821) | answered Mar 10 '11, 7:29 a.m.
You can use "getAuthenticatedContributor()" to get the contributor ItemHandler and then use "IRepositoryItemService" to fetch IContributor.

Something like this:


IRepositoryItemService repositoryService = getService(IRepositoryItemService.class);
IContributor loggedContributor = (IContributor) repositoryService.fetchItem(getAuthenticatedContributor(), null);


Hi,
I am developing a pre-condition and extending AbstractService, implementing IOperationAdvisor.
I am binding the pre-condition to work item save operation.
Is it possible to read connected users ID?
If yes, Can you please provide appropriate APIs?
Thanks,

Your answer


Register or to post your answer.