How can I temporarily "sudo" to another user in a
![](http://jazz.net/_images/myphoto/5534ef92347b10c08423919f1c8f6e72.jpg)
2 answers
![](http://jazz.net/_images/myphoto/5534ef92347b10c08423919f1c8f6e72.jpg)
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.