io.javalin.security.AccessManager Maven / Gradle / Ivy
The newest version!
/*
* Javalin - https://javalin.io
* Copyright 2017 David Åse
* Licensed under Apache 2.0: https://github.com/tipsy/javalin/blob/master/LICENSE
*/
package io.javalin.security;
import io.javalin.Context;
import io.javalin.Handler;
import io.javalin.core.HandlerType;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
/**
* The access manager is a way of implementing per-endpoint security management.
* It's only enabled for endpoints if a list of roles is provided.
* Ex: get("/secured", SecuredController::get, roles(LOGGED_IN));
*
* @see Role
* @see io.javalin.Javalin#addHandler(HandlerType, String, Handler, Set)
* @see Access manager in docs
*/
@FunctionalInterface
public interface AccessManager {
void manage(@NotNull Handler handler, @NotNull Context ctx, @NotNull Set permittedRoles) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy