Example #1
0
  public ArrayList<SelectItem> getPendingSelectActionList2() {
    if (pendingActionList2 != null) {
      return pendingActionList2;
    }

    pendingActionList2 = new ArrayList<SelectItem>();
    ResourceLoader com =
        new ResourceLoader("org.sakaiproject.tool.assessment.bundle.CommonMessages");
    AuthorizationBean authorizationBean =
        (AuthorizationBean) ContextUtil.lookupBean("authorization");

    boolean isEditAnyAssessment = authorizationBean.getEditAnyAssessment();
    boolean isEditOwnAssessment = authorizationBean.getEditOwnAssessment();
    boolean isDeleteAnyAssessment = authorizationBean.getDeleteAnyAssessment();
    boolean isDeleteOwnAssessment = authorizationBean.getDeleteOwnAssessment();

    pendingActionList2.add(new SelectItem("select", com.getString("action_select")));
    if (isEditAnyAssessment || isEditOwnAssessment) {
      pendingActionList2.add(new SelectItem("edit_pending", com.getString("edit_action")));
      pendingActionList2.add(new SelectItem("preview_pending", com.getString("action_preview")));
      if (ServerConfigurationService.getBoolean("samigo.printAssessment", true)) {
        pendingActionList2.add(new SelectItem("print_pending", com.getString("action_print")));
      }
      pendingActionList2.add(new SelectItem("settings_pending", com.getString("settings_action")));
      pendingActionList2.add(new SelectItem("duplicate", com.getString("action_duplicate")));
      pendingActionList2.add(new SelectItem("export", com.getString("export_action")));
    }
    if (isDeleteAnyAssessment || isDeleteOwnAssessment) {
      pendingActionList2.add(new SelectItem("remove_pending", com.getString("remove_action")));
    }
    return pendingActionList2;
  }
Example #2
0
  public Boolean getCanRemovePublishedAssessments() {
    if (canRemovePublishedAssessments == null) {
      AuthorizationBean authorizationBean =
          (AuthorizationBean) ContextUtil.lookupBean("authorization");

      boolean isDeleteAnyAssessment = authorizationBean.getDeleteAnyAssessment();
      boolean isDeleteOwnAssessment = authorizationBean.getDeleteOwnAssessment();
      if (isDeleteAnyAssessment || isDeleteOwnAssessment) {
        canRemovePublishedAssessments = Boolean.TRUE;
      } else {
        canRemovePublishedAssessments = Boolean.FALSE;
      }
    }

    return canRemovePublishedAssessments;
  }