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

How can I temporarily "sudo" to another user in a

In a follow-up plugin I need the user who performed the save on the WI to temporarily gain more permissions and perform actions in the plugin; reverting back to normal permissions on plugin termination.

0 votes



2 answers

Permanent link
Hi,
I think you can try to use com.ibm.team.repository.service.IImpersonationService to run some code under a different user.

Michele.

0 votes


Permanent link
You can use the "com.ibm.team.repository.service.IImpersonationService" service:
IContributorHandle contributorH = ...
IImpersonationService impersonationService = getService(IImpersonationService.class);
impersonationService.runAs(contributorH, new IImpersonationService.ImpersonationRunnable() {
public void run() throws Exception {
// ...
}
);
Be aware of the logged-in contributor must have administrator permissions.

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

Question asked: Jul 05 '11, 3:27 p.m.

Question was seen: 4,973 times

Last updated: May 15 '13, 9:51 a.m.

Confirmation Cancel Confirm