use of nl.nn.testtool.echo2.Echo2Application in project iaf by ibissource.
the class TibetView method isOpenReportAllowedViaAdapter.
public String isOpenReportAllowedViaAdapter(Object StorageId) {
Echo2Application app = getEcho2Application();
IAdapter adapter = ibisManager.getRegisteredAdapter(AUTHORISATION_CHECK_ADAPTER);
if (adapter == null) {
return "Not allowed. Could not find adapter " + AUTHORISATION_CHECK_ADAPTER;
} else {
PipeLineSession pipeLineSession = new PipeLineSession();
if (app.getUserPrincipal() != null)
pipeLineSession.put("principal", app.getUserPrincipal().getName());
pipeLineSession.put("StorageId", StorageId);
pipeLineSession.put("View", getName());
PipeLineResult processResult = adapter.processMessage(null, new Message("<dummy/>"), pipeLineSession);
if (processResult.isSuccessful()) {
return ReportsComponent.OPEN_REPORT_ALLOWED;
} else {
return "Not allowed. Result of adapter " + AUTHORISATION_CHECK_ADAPTER + ": " + processResult.getResult();
}
}
}
Aggregations