Class AuthorizationManagerWebInvocationPrivilegeEvaluator
java.lang.Object
org.springframework.security.web.access.AuthorizationManagerWebInvocationPrivilegeEvaluator
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- WebInvocationPrivilegeEvaluator,- org.springframework.web.context.ServletContextAware
public final class AuthorizationManagerWebInvocationPrivilegeEvaluator
extends Object
implements WebInvocationPrivilegeEvaluator, org.springframework.web.context.ServletContextAware
An implementation of 
WebInvocationPrivilegeEvaluator which delegates the checks
 to an instance of AuthorizationManager- Since:
- 5.5.5
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceUsed to transform theHttpServletRequestprior to passing it into theAuthorizationManager.
- 
Constructor SummaryConstructorsConstructorDescriptionAuthorizationManagerWebInvocationPrivilegeEvaluator(AuthorizationManager<jakarta.servlet.http.HttpServletRequest> authorizationManager) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisAllowed(String contextPath, String uri, String method, Authentication authentication) Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI, with the given parameters.booleanisAllowed(String uri, Authentication authentication) Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI.voidsetRequestTransformer(AuthorizationManagerWebInvocationPrivilegeEvaluator.HttpServletRequestTransformer requestTransformer) Set aAuthorizationManagerWebInvocationPrivilegeEvaluator.HttpServletRequestTransformerto be used prior to passing to theAuthorizationManager.voidsetServletContext(jakarta.servlet.ServletContext servletContext) 
- 
Constructor Details- 
AuthorizationManagerWebInvocationPrivilegeEvaluatorpublic AuthorizationManagerWebInvocationPrivilegeEvaluator(AuthorizationManager<jakarta.servlet.http.HttpServletRequest> authorizationManager) 
 
- 
- 
Method Details- 
isAllowedDescription copied from interface:WebInvocationPrivilegeEvaluatorDetermines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI.Note this will only match authorization rules that don't require a certain HttpMethod.- Specified by:
- isAllowedin interface- WebInvocationPrivilegeEvaluator
- Parameters:
- uri- the URI excluding the context path (a default context path setting will be used)
 
- 
isAllowedpublic boolean isAllowed(String contextPath, String uri, String method, Authentication authentication) Description copied from interface:WebInvocationPrivilegeEvaluatorDetermines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI, with the given parameters.Note: - The default implementation of FilterInvocationSecurityMetadataSource
 disregards the contextPathwhen evaluating which secure object metadata applies to a given request URI, so generally thecontextPathis unimportant unless you are using a customFilterInvocationSecurityMetadataSource.
- this will only match authorization rules that don't require a certain
 HttpMethod.
 - Specified by:
- isAllowedin interface- WebInvocationPrivilegeEvaluator
- Parameters:
- contextPath- the context path (may be null).
- uri- the URI excluding the context path
- method- the HTTP method (or null, for any method)
- authentication- the Authentication instance whose authorities should be used in evaluation whether access should be granted.
- Returns:
- true if access is allowed, false if denied
 
- The default implementation of FilterInvocationSecurityMetadataSource
 disregards the 
- 
setServletContextpublic void setServletContext(jakarta.servlet.ServletContext servletContext) - Specified by:
- setServletContextin interface- org.springframework.web.context.ServletContextAware
 
- 
setRequestTransformerpublic void setRequestTransformer(AuthorizationManagerWebInvocationPrivilegeEvaluator.HttpServletRequestTransformer requestTransformer) Set aAuthorizationManagerWebInvocationPrivilegeEvaluator.HttpServletRequestTransformerto be used prior to passing to theAuthorizationManager.- Parameters:
- requestTransformer- the- AuthorizationManagerWebInvocationPrivilegeEvaluator.HttpServletRequestTransformerto use.
 
 
-