java.lang.Object
ch.raffael.meldioc.library.http.server.undertow.handler.AccessCheckHandler
All Implemented Interfaces:
io.undertow.server.HttpHandler

public class AccessCheckHandler extends Object implements 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.
  • Constructor Details

  • 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

      public static <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)
    • handleRequest

      public void handleRequest(io.undertow.server.HttpServerExchange exchange) throws Exception
      Specified by:
      handleRequest in interface io.undertow.server.HttpHandler
      Throws:
      Exception