Class SessionHelper
java.lang.Object
com.ptc.arbortext.windchill.siscore.SessionHelper
Reliable implementations for temporarily switching principals as well as turning access enforcement on and off
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAutoCloseableimplementation for establishing a SessionContext for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope. -
Method Summary
Modifier and TypeMethodDescriptionstatic AutoCloseabletemporaryAccessEnforcement(boolean newAccessEnforcement) Change access enforcement for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope.static AutoCloseableChange user context to administrator for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope.static AutoCloseabletemporaryPrincipal(String newPrincipalName) Change user context to new user for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope.static AutoCloseabletemporaryPrincipal(WTPrincipal newPrincipal) Change user context to new user for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope.
-
Method Details
-
temporaryPrincipal
Change user context to new user for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope. Usage:try (AutoCloseable tempSession = PrincipalHelper.temporaryPrincipal(newUser)) { ... use temporary SessionContext ... ... previous SessionContext is always restored when leaving this scope ... }AutoCloseable
Supported API: true
Extendable: false- Throws:
WTException
-
temporaryPrincipal
Change user context to new user for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope. Usage:try (AutoCloseable tempSession = PrincipalHelper.temporaryPrincipal("demo")) { ... use temporary SessionContext ... ... previous SessionContext is always restored when leaving this scope ... }AutoCloseable
Supported API: true
Extendable: false- Throws:
WTException
-
temporaryAdministrator
Change user context to administrator for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope. Usage:try (AutoCloseable tempSession = PrincipalHelper.temporaryAdministrator()) { ... use temporary SessionContext ... ... previous SessionContext is always restored when leaving this scope ... }AutoCloseable
Supported API: true
Extendable: false- Throws:
WTException
-
temporaryAccessEnforcement
public static AutoCloseable temporaryAccessEnforcement(boolean newAccessEnforcement) throws WTException Change access enforcement for a clearly delimited scope, restoring the previous SessionContext upon leaving this scope. Usage:try (AutoCloseable tempSession = PrincipalHelper.temporaryAccessEnforcement(true)) { ... use temporary SessionContext ... ... previous SessionContext is always restored when leaving this scope ... }AutoCloseable
Supported API: true
Extendable: false- Throws:
WTException
-