Interface RouteAccessControl
-
- All Known Implementing Classes:
AccessCombinerAllRequired,AccessCombinerAnyRequired
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RouteAccessControlControls access to a mounted route. Each request must first pass through the route's route access control and get a true response, otherwise the request is handled by thehandleAccessDenied(RequestContext, HttpServletResponse)method.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanAccess(RequestContext context)Return true if access is granted.default voidhandleAccessDenied(RequestContext context, javax.servlet.http.HttpServletResponse response)What to do if the access is denied.static RouteAccessControlrequireAll(RouteAccessControl... multiple)Static convenience combiner to require all of any number of different access controlsstatic RouteAccessControlrequireAny(RouteAccessControl... multiple)Static convenience combiner to require at least one of any number of different access controls
-
-
-
Method Detail
-
canAccess
boolean canAccess(RequestContext context)
Return true if access is granted.
-
handleAccessDenied
default void handleAccessDenied(RequestContext context, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
What to do if the access is denied. Default implementation simply returns error code 403- Throws:
java.io.IOException
-
requireAll
static RouteAccessControl requireAll(RouteAccessControl... multiple)
Static convenience combiner to require all of any number of different access controls
-
requireAny
static RouteAccessControl requireAny(RouteAccessControl... multiple)
Static convenience combiner to require at least one of any number of different access controls
-
-