Class AccessCheckHandler
java.lang.Object
ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler
- All Implemented Interfaces:
io.undertow.server.HttpHandler
A handler that checks if the current user has access to the following
handlers. If the user does not have access, 403 Forbidden is returned.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAccessCheckHandler.AccessByRole<R extends Role>static interface -
Constructor Summary
ConstructorsConstructorDescriptionAccessCheckHandler(AccessCheckHandler.AccessRestriction restriction, io.undertow.server.HttpHandler next) -
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends Enum<?> & Role>
ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler.AccessByRoleEnum<R>accessByRole(Class<R> enumType, io.vavr.collection.Set<? extends R> roles) static <R extends Role>
AccessCheckHandler.AccessByRole<R>accessByRole(Function<? super String, ? extends io.vavr.control.Option<? extends R>> mapper, io.vavr.collection.Set<? extends R> roles) voidhandleRequest(io.undertow.server.HttpServerExchange exchange)
-
Constructor Details
-
AccessCheckHandler
public AccessCheckHandler(AccessCheckHandler.AccessRestriction restriction, io.undertow.server.HttpHandler next)
-
-
Method Details
-
accessByRole
public static <R extends Role> AccessCheckHandler.AccessByRole<R> accessByRole(Function<? super String, ? extends io.vavr.control.Option<? extends R>> mapper, io.vavr.collection.Set<? extends R> roles) -
accessByRole
-
handleRequest
- Specified by:
handleRequestin interfaceio.undertow.server.HttpHandler- Throws:
Exception
-