Domino Brix is a lightweight MVP framework for DominoKit apps. It combines routing, presenters, slots, events, startup tasks, and security into a cohesive runtime with generated presenters, views, and initializers.
Add the runtime and processor to your project (processor as provided for client builds):
@BrixPresenter
public class AdminPresenter extends Presenter<AdminView> {
@Override
public Set<String> getRoles() {
return Set.of("admin");
}
@Override
public Authorizer getAuthorizer() {
return RolesAllowedAuthorizer.INSTANCE;
}
}
Initialize configuration, then start the router and startup tasks. The generated presenters and views are discovered automatically.
SecurityContext sc = (SecurityContext) Brix.get().getCoreComponent().core().getSecurityContext();
sc.setUser(new MyUser());
sc.setUnauthorizedAccessHandler(() -> window.alert("Access denied"));