@Roles

An application can define a @Roles annotation. If the annotation matches the name "Roles" then it is deemed to define application security roles and generates appropriate code in the web route.

@Roles({ADMIN})
@Get
List<HelloDto> getAll() {
  ...
}

The generated code includes the Javalin roles check.

// Generated code ...

ApiBuilder.get("/hello", ctx -> {
  ctx.json(controller.getAll());
  ctx.status(200);
}, roles(ADMIN));