78 lines
1.5 KiB
Java
78 lines
1.5 KiB
Java
/*
|
|
*
|
|
*/
|
|
package io.kumare.iqr.app;
|
|
|
|
// base
|
|
import io.kumare.lib.app.api.module.ServiceModuleController;
|
|
import io.kumare.lib.app.api.security.PermissionReference;
|
|
import io.kumare.lib.base.server.spring.BaseContext;
|
|
// app
|
|
import io.kumare.iqr.app.adapter.AppAdapters;
|
|
import io.kumare.iqr.app.module.AppModules;
|
|
import io.kumare.iqr.app.security.AppSecurityContext;
|
|
|
|
/**
|
|
*
|
|
* @author afatecha
|
|
*/
|
|
public class AppContext extends BaseContext {
|
|
|
|
// ::: cons
|
|
//
|
|
private final AppSecurityContext security = new AppSecurityContext(this);
|
|
|
|
// ::: vars
|
|
//
|
|
|
|
// ::: fields
|
|
//
|
|
@Override
|
|
public AppEngine getEngine() {
|
|
return AppEngine.getEngine();
|
|
}
|
|
|
|
// ::: adapters
|
|
//
|
|
@Override
|
|
public AppAdapters getAdapters() {
|
|
return App.getAdapters();
|
|
}
|
|
|
|
// ::: modules
|
|
//
|
|
@Override
|
|
public AppModules getModules() {
|
|
return App.getModules();
|
|
}
|
|
|
|
@Override
|
|
public ServiceModuleController getController(String name) {
|
|
return App.getController(name);
|
|
}
|
|
|
|
// ::: security
|
|
//
|
|
@Override
|
|
public AppSecurityContext getSecurity() {
|
|
return security;
|
|
}
|
|
|
|
@Override
|
|
public void ensureAuthorization(PermissionReference ref) {
|
|
/*
|
|
var attached = isAttached("authorized");
|
|
if(attached && (Boolean) get("authorized")) {
|
|
return;
|
|
}
|
|
|
|
var controller = AppModules.auth.getController();
|
|
var allowed = controller.isAllowed(this, ref);
|
|
V.ifFalse(allowed, ref.getError());
|
|
attach("authorized", true);*/
|
|
}
|
|
|
|
}
|
|
|
|
|