if (TreebaseUtil.isEmpty(analysis_id)) {
if (perm == TBPermission.WRITE) {
LOGGER.info("setAuthorizationChecked(true)");
setAuthorizationChecked(true);
return new Analysis();
} else {
LOGGER.info("setAuthorizationChecked(false)");
setAuthorizationChecked(false);
return null;
}
} else {
long analysis_id_long = Long.parseLong(analysis_id);
TBPermission perm2 = getAnalysisService().getPermission(username, analysis_id_long);
if (perm2 == TBPermission.WRITE || perm2 == TBPermission.READ_ONLY
|| perm2 == TBPermission.SUBMITTED_WRITE) {
Analysis analysis = mAnalysisService.findByID(analysis_id_long);
ControllerUtil.saveAnalysis(request, analysis);
if (perm2 == TBPermission.READ_ONLY) {
// FIXME set a session variable to hide the edit buttons.
}
LOGGER.info("setAuthorizationChecked(true)");
setAuthorizationChecked(true);
return analysis;
} else {
LOGGER.debug("NULL CONDITION SATISFIED");
LOGGER.info("setAuthorizationChecked(false)");
setAuthorizationChecked(false);
return new Analysis();
}
}
}