public interface PolicyUtils
Authentication
. This is generally subclassed to provide business
rule verification on additional context information outside of Spring granted authorities alone.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_AUTH_DETAILS_OWNER_ID
Key used when determining if a user owns a particular entity.
|
static org.slf4j.Logger |
log |
static String |
ROLE_ANONYMOUS |
Modifier and Type | Method and Description |
---|---|
default String |
getAuthDetailsOwnerIdentifier() |
default org.springframework.security.core.Authentication |
getAuthentication()
Retrieve the current Spring
Authentication instance associated with the current flow,
if any. |
Map<String,Object> |
getAuthenticationAttributes()
Retrieves the attributes on the current
Authentication that are useful in making
policy determinations. |
default PolicyResponse |
validatePermissions(String[] permissions,
ContextInfo contextInfo)
Determine if the current security context (e.g.
|
static final org.slf4j.Logger log
static final String ROLE_ANONYMOUS
static final String DEFAULT_AUTH_DETAILS_OWNER_ID
Owned
,
Constant Field Valuesdefault org.springframework.security.core.Authentication getAuthentication()
Authentication
instance associated with the current flow,
if any.Authentication
instance associated with the current flowMap<String,Object> getAuthenticationAttributes()
Authentication
that are useful in making
policy determinations. This method is expected to return the attributes in a map which is
generally achieved by a registered Converter
bean.Authentication
default PolicyResponse validatePermissions(@Nullable String[] permissions, @Nullable ContextInfo contextInfo)
Determine if the current security context (e.g. Authentication
) is valid against the
requested permission. If Spring Security is disabled (no Authentication
available),
the response will be PolicyResponse.VALID
.
permissions
- the permissions to check. A single permission in the current
getAuthentication()
must match to pass the policycontextInfo
- the context containing multitenant application, tenant and catalog
information. Not used in the default implementation, though custom implementations may
use this for validation purposes.default String getAuthDetailsOwnerIdentifier()
Copyright © 2021. All rights reserved.