Class SecurityUtils
java.lang.Object
org.eclipse.jetty.util.security.SecurityUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Runs the given action as the given subject.static void
checkPermission
(Permission permission) Checks the given permission, if thesecurity manager
is set.static <T> T
Deprecated, for removal: This API element is subject to removal in a future version.static <T> T
doPrivileged
(PrivilegedAction<T> action) Runs the given action with the calling context restricted to just the calling frame, not all the frames in the stack.static Object
Get the current security manager, if available.
-
Method Details
-
getSecurityManager
Get the current security manager, if available.- Returns:
- the current security manager, if available
-
checkPermission
Checks the given permission, if the
security manager
is set.- Parameters:
permission
- the permission to check- Throws:
SecurityException
- if the permission check fails
-
doPrivileged
Runs the given action with the calling context restricted to just the calling frame, not all the frames in the stack.
- Type Parameters:
T
- the type of the result- Parameters:
action
- the action to run- Returns:
- the result of running the action
-
doAs
@Deprecated(forRemoval=true, since="12.1.0") public static <T> T doAs(Subject subject, Callable<T> action) Deprecated, for removal: This API element is subject to removal in a future version.Runs the action as the given subject.
- Type Parameters:
T
- the type of the result- Parameters:
subject
- the subject this action runs asaction
- the action to run- Returns:
- the result of the action
-
callAs
-
callAs(Subject, Callable)