public interface EscalatedSecurityContext
Operation
should be called.Modifier and Type | Method and Description |
---|---|
void |
applyToRequest()
Escalates the security context as the specified user and added permissions for the duration of the current request.
|
<T,E extends Throwable> |
call(Operation<T,E> operation)
Executes an Operation as the specified user and added permissions.
|
EscalatedSecurityContext |
withPermission(Object resource,
Permission permission)
Adds permissions on a particular resource to the set of elevated permissions.
|
EscalatedSecurityContext |
withPermission(Permission permission)
Adds permissions to the set of elevated permissions.
|
EscalatedSecurityContext |
withPermissions(Set<Permission> permissions)
Adds permissions to the set of elevated permissions.
|
<T,E extends Throwable> T call(@Nonnull Operation<T,E> operation) throws E extends Throwable
Note: Nesting invocations merges all elevated permissions rather than replacing the previous values.
E
- type of exceptionT
- type of the operationoperation
- the operation to be executedE
- when the provided operation throws an exceptionE extends Throwable
void applyToRequest()
IllegalStateException
- if there is no request
in scope for the current thread@Nonnull EscalatedSecurityContext withPermission(@Nonnull Permission permission)
permission
- the permission to be temporarily granted@Nonnull EscalatedSecurityContext withPermission(@Nonnull Object resource, @Nonnull Permission permission)
resource
- the resourcepermission
- the permission to be temporarily granted on the provided resource@Nonnull EscalatedSecurityContext withPermissions(@Nonnull Set<Permission> permissions)
permissions
- the permissions to be temporarily grantedCopyright © 2020 Atlassian. All rights reserved.