Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi Dax,
you can use this code to do anything in Windchill as any user:
try{
SessionContext previous_context = SessionContext.newContext();
SessionMgr.setPrincipal(creator.getName()); // for example... You can use any user
// Your code that needs to be executed as another user...
} catch(Exception e) {
e.printStackTrace();
} finally {
if (previous_context != null) {
SessionContext.setContext(previous_context);
}
}
Iker Mendiola
Prambanan IT Services
http://en.prambanan-it.com
Iker Mendiola - Prambanan IT Services |
Iker Mendiola - Prambanan IT Services |