public interface ScopesRequestCache
| Modifier and Type | Interface and Description |
|---|---|
static class |
ScopesRequestCache.RequestCache
The state of the ScopesRequestCache
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearRequestCache()
Removes the scopes request cache.
|
boolean |
containsOnlyThisScope(Scope scope)
Checks if the cache contains only the passed scope
|
Optional<String> |
getApplicationNameForRequest()
Gets the application name for the OAuth 2 request if this is one
Otherwise returns an empty Optional
|
Set<Permission> |
getPermissionsForRequest()
Gets the current set of permissions for the request
|
ScopesRequestCache.RequestCache |
getRequestCache()
Gets a copy of the stored request cache
|
boolean |
hasPermission(Permission permission)
Using the scope cache, checks if the request has the specified permission
|
void |
setRequestCache(ScopesRequestCache.RequestCache requestCache)
Allows the request cache to be manually set.
|
Closeable |
withScopes(Scope scope,
Supplier<Optional<String>> applicationNameSupplier)
Applies scopes to Request cache.
|
Closeable withScopes(Scope scope, Supplier<Optional<String>> applicationNameSupplier)
scope - the scopes applied during the actionapplicationNameSupplier - attempts to supply the application name for the requestboolean containsOnlyThisScope(Scope scope)
scope - the scope to check if it exists alone in the cacheboolean hasPermission(Permission permission)
permission - the permission to check@Nonnull Optional<String> getApplicationNameForRequest()
@Nonnull Set<Permission> getPermissionsForRequest()
ScopesRequestCache.RequestCache getRequestCache()
void setRequestCache(@Nullable ScopesRequestCache.RequestCache requestCache)
requestCache - the request cache to storevoid clearRequestCache()
Copyright © 2020–2023 Atlassian. All rights reserved.