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.
Controls 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 the
handleAccessDenied(RequestContext, HttpServletResponse)
method.-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAccess
(RequestContext context) Return true if access is granted.default void
handleAccessDenied
(RequestContext context, javax.servlet.http.HttpServletResponse response) What to do if the access is denied.static RouteAccessControl
requireAll
(RouteAccessControl... multiple) Static convenience combiner to require all of any number of different access controlsstatic RouteAccessControl
requireAny
(RouteAccessControl... multiple) Static convenience combiner to require at least one of any number of different access controls
-
Method Details
-
canAccess
Return true if access is granted. -
handleAccessDenied
default void handleAccessDenied(RequestContext context, javax.servlet.http.HttpServletResponse response) throws IOException What to do if the access is denied. Default implementation simply returns error code 403- Throws:
IOException
-
requireAll
Static convenience combiner to require all of any number of different access controls -
requireAny
Static convenience combiner to require at least one of any number of different access controls
-