- Type Parameters:
T- type of requests to check authorization for
- All Known Implementing Classes:
public interface AuthorizationHandler<T>
Handles the mapping of routes to roles.
useAdds a new route to the handler.
route- the route to add
getRequestHandler<T> get(String route, RoleType role) throws AuthorizationRequiredException, HandlerMissingExceptionRetrieves the RequestHandler of a route matching the route id and that any of the given roles have permission to.
route- the id of the route to retrieve
role- the role used in the authorization check
- a request handler used for the route.
AuthorizationRequiredException- when a route exists but none of the given roles has permission to execute it.
HandlerMissingException- when the requested route is missing.
containsboolean contains(String route)
route- id of the route to check if it is contained in the handler.
- true if the route is registered.
- all routes that has been added to the handler.