Class AccessCheckHandler
- java.lang.Object
-
- ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler
-
- All Implemented Interfaces:
io.undertow.server.HttpHandler
public class AccessCheckHandler extends java.lang.Object implements io.undertow.server.HttpHandlerA 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 Classes Modifier and Type Class Description static classAccessCheckHandler.AccessByRole<R extends Role>static interfaceAccessCheckHandler.AccessRestriction
-
Constructor Summary
Constructors Constructor Description AccessCheckHandler(AccessCheckHandler.AccessRestriction restriction, io.undertow.server.HttpHandler next)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <R extends java.lang.Enum & Role>
ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler.AccessByRoleEnum<R>accessByRole(java.lang.Class<R> enumType, io.vavr.collection.Set<? extends R> roles)static <R extends Role>
AccessCheckHandler.AccessByRole<R>accessByRole(java.util.function.Function<? super java.lang.String,? extends io.vavr.control.Option<? extends R>> mapper, io.vavr.collection.Set<? extends R> roles)voidhandleRequest(io.undertow.server.HttpServerExchange exchange)
-
-
-
Constructor Detail
-
AccessCheckHandler
public AccessCheckHandler(AccessCheckHandler.AccessRestriction restriction, io.undertow.server.HttpHandler next)
-
-
Method Detail
-
accessByRole
public static <R extends Role> AccessCheckHandler.AccessByRole<R> accessByRole(java.util.function.Function<? super java.lang.String,? extends io.vavr.control.Option<? extends R>> mapper, io.vavr.collection.Set<? extends R> roles)
-
accessByRole
public static <R extends java.lang.Enum & Role> ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler.AccessByRoleEnum<R> accessByRole(java.lang.Class<R> enumType, io.vavr.collection.Set<? extends R> roles)
-
handleRequest
public void handleRequest(io.undertow.server.HttpServerExchange exchange) throws java.lang.Exception- Specified by:
handleRequestin interfaceio.undertow.server.HttpHandler- Throws:
java.lang.Exception
-
-