Package io.undertow.servlet.core
Class DefaultAuthorizationManager
- java.lang.Object
-
- io.undertow.servlet.core.DefaultAuthorizationManager
-
- All Implemented Interfaces:
AuthorizationManager
public class DefaultAuthorizationManager extends Object implements AuthorizationManager
Default authorization manager that simply implements the rules as specified by the servlet spec- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultAuthorizationManagerINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanAccessResource(List<SingleConstraintMatch> constraints, Account account, ServletInfo servletInfo, jakarta.servlet.http.HttpServletRequest request, Deployment deployment)Tests if a user can access a given resourcebooleanisUserInRole(String role, Account account, ServletInfo servletInfo, jakarta.servlet.http.HttpServletRequest request, Deployment deployment)Tests if a user is in a given roleTransportGuaranteeTypetransportGuarantee(TransportGuaranteeType currentConnectionGuarantee, TransportGuaranteeType configuredRequiredGuarentee, jakarta.servlet.http.HttpServletRequest request)Determines the transport guarantee type
-
-
-
Field Detail
-
INSTANCE
public static final DefaultAuthorizationManager INSTANCE
-
-
Method Detail
-
isUserInRole
public boolean isUserInRole(String role, Account account, ServletInfo servletInfo, jakarta.servlet.http.HttpServletRequest request, Deployment deployment)
Description copied from interface:AuthorizationManagerTests if a user is in a given role- Specified by:
isUserInRolein interfaceAuthorizationManager- Parameters:
role- The role nameaccount- The user accountservletInfo- The servlet info for the target servletrequest- The servlet requestdeployment- The deployment- Returns:
- true if the user is in the role
-
canAccessResource
public boolean canAccessResource(List<SingleConstraintMatch> constraints, Account account, ServletInfo servletInfo, jakarta.servlet.http.HttpServletRequest request, Deployment deployment)
Description copied from interface:AuthorizationManagerTests if a user can access a given resource- Specified by:
canAccessResourcein interfaceAuthorizationManager- Parameters:
constraints- The constraintsaccount- The users accountservletInfo- The servlet info for the target servletrequest- The servlet requestdeployment- The deployment- Returns:
- true if the user can access the resource
-
transportGuarantee
public TransportGuaranteeType transportGuarantee(TransportGuaranteeType currentConnectionGuarantee, TransportGuaranteeType configuredRequiredGuarentee, jakarta.servlet.http.HttpServletRequest request)
Description copied from interface:AuthorizationManagerDetermines the transport guarantee type- Specified by:
transportGuaranteein interfaceAuthorizationManager- Parameters:
currentConnectionGuarantee- The current connections transport guarantee typeconfiguredRequiredGuarentee- The transport guarantee type specified in the deployment descriptor/annotationsrequest- The request- Returns:
- The transport guarantee type
-
-