use of org.akaza.openclinica.web.InsufficientPermissionException in project OpenClinica by OpenClinica.
the class ViewSectionDataEntryPreview method mayProceed.
/**
* Checks whether the user has the correct privilege. This is from
* ViewSectionDataEntryServlet.
*/
@Override
public void mayProceed(HttpServletRequest request, HttpServletResponse response) throws InsufficientPermissionException {
UserAccountBean ub = (UserAccountBean) request.getSession().getAttribute(USER_BEAN_NAME);
StudyUserRoleBean currentRole = (StudyUserRoleBean) request.getSession().getAttribute("userRole");
if (ub.isSysAdmin()) {
return;
}
if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR) || currentRole.getRole().equals(Role.INVESTIGATOR) || currentRole.getRole().equals(Role.RESEARCHASSISTANT) || currentRole.getRole().equals(Role.RESEARCHASSISTANT2)) {
return;
}
addPageMessage(respage.getString("no_have_correct_privilege_current_study") + " " + respage.getString("change_active_study_or_contact"), request);
throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString("not_director"), "1");
}
use of org.akaza.openclinica.web.InsufficientPermissionException in project OpenClinica by OpenClinica.
the class DownloadAttachedFileServlet method mayProceed.
/**
* Checks whether the user has the correct privilege
*/
@Override
public void mayProceed() throws InsufficientPermissionException {
Locale locale = LocaleResolver.getLocale(request);
FormProcessor fp = new FormProcessor(request);
if (ub.isSysAdmin()) {
return;
}
if (SubmitDataServlet.mayViewData(ub, currentRole)) {
return;
}
request.setAttribute("downloadStatus", "false");
addPageMessage(respage.getString("you_not_have_permission_download_attached_file"));
throw new InsufficientPermissionException(Page.DOWNLOAD_ATTACHED_FILE, resexception.getString("no_permission"), "1");
}
use of org.akaza.openclinica.web.InsufficientPermissionException in project OpenClinica by OpenClinica.
the class ImportCRFDataServlet method mayProceed.
// < ResourceBundleresword,resexception,respage;
/**
*
*/
@Override
public void mayProceed() throws InsufficientPermissionException {
checkStudyLocked(Page.MENU_SERVLET, respage.getString("current_study_locked"));
checkStudyFrozen(Page.MENU_SERVLET, respage.getString("current_study_frozen"));
locale = LocaleResolver.getLocale(request);
if (ub.isSysAdmin()) {
return;
}
Role r = currentRole.getRole();
if (r.equals(Role.STUDYDIRECTOR) || r.equals(Role.COORDINATOR) || r.equals(Role.INVESTIGATOR) || r.equals(Role.RESEARCHASSISTANT) || r.equals(Role.RESEARCHASSISTANT2)) {
return;
}
addPageMessage(respage.getString("no_have_correct_privilege_current_study") + respage.getString("change_study_contact_sysadmin"));
throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString("may_not_submit_data"), "1");
}
use of org.akaza.openclinica.web.InsufficientPermissionException in project OpenClinica by OpenClinica.
the class ImportRuleServlet method mayProceed.
@Override
public void mayProceed() throws InsufficientPermissionException {
locale = LocaleResolver.getLocale(request);
if (ub.isSysAdmin()) {
return;
}
Role r = currentRole.getRole();
if (r.equals(Role.STUDYDIRECTOR) || r.equals(Role.COORDINATOR)) {
return;
}
addPageMessage(respage.getString("no_have_correct_privilege_current_study") + respage.getString("change_study_contact_sysadmin"));
throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString("may_not_submit_data"), "1");
}
use of org.akaza.openclinica.web.InsufficientPermissionException in project OpenClinica by OpenClinica.
the class MarkEventCRFCompleteServlet method mayProceed.
/*
* (non-Javadoc)
*
* @see org.akaza.openclinica.control.core.SecureController#mayProceed()
*/
@Override
protected void mayProceed() throws InsufficientPermissionException {
locale = LocaleResolver.getLocale(request);
// <
// resexception=ResourceBundle.getBundle(
// "org.akaza.openclinica.i18n.exceptions",locale);
// < respage =
// ResourceBundle.getBundle("org.akaza.openclinica.i18n.page_messages",
// locale);
// < resword =
// ResourceBundle.getBundle("org.akaza.openclinica.i18n.words",locale);
fp = new FormProcessor(request);
if (currentRole.equals(Role.COORDINATOR) || currentRole.equals(Role.STUDYDIRECTOR)) {
return;
}
getEventCRFBean();
Role r = currentRole.getRole();
if (ecb.getStage().equals(DataEntryStage.INITIAL_DATA_ENTRY)) {
if (ecb.getOwnerId() != ub.getId() && !r.equals(Role.COORDINATOR) && !r.equals(Role.STUDYDIRECTOR)) {
request.setAttribute(TableOfContentsServlet.INPUT_EVENT_CRF_BEAN, ecb);
addPageMessage(respage.getString("not_mark_CRF_complete6"));
throw new InsufficientPermissionException(Page.TABLE_OF_CONTENTS_SERVLET, resexception.getString("not_study_owner"), "1");
}
} else if (ecb.getStage().equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
if (ecb.getValidatorId() != ub.getId() && !r.equals(Role.COORDINATOR) && !r.equals(Role.STUDYDIRECTOR)) {
request.setAttribute(TableOfContentsServlet.INPUT_EVENT_CRF_BEAN, ecb);
addPageMessage(respage.getString("not_mark_CRF_complete7"));
throw new InsufficientPermissionException(Page.TABLE_OF_CONTENTS_SERVLET, resexception.getString("not_study_owner"), "1");
}
}
return;
}
Aggregations