Examples of TBPermission


Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

    String subid = ServletRequestUtils.getStringParameter(request, "submissionid", null);

    // FIXME: move the method to studyService, handle the case study w/o submission
    // Here I am making sure that attempt is made to delete a study owned by the user
    // and not the one owned by anyone else.
    TBPermission perm = getSubmissionService().getPermission(username, Long.parseLong(subid));

    if (perm == TBPermission.WRITE) {
      LOGGER.info("setAuthorizationChecked(true)");
      setAuthorizationChecked(true);
    } else {
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

   * @param pUser
   * @return
   */
  public TBPermission getPermission(User pUser) {

    TBPermission perm = TBPermission.READ_ONLY;
    if (pUser == null) {
      // either the submission has no submitter or the user is not logged in.
      if (isPublished()) {
        perm = TBPermission.READ_ONLY;
      } else {
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

        submissionId = sub.getId();
      }
    }

    // FIXME: move the method to studyService, handle the case study w/o submission
    TBPermission perm = getSubmissionService().getPermission(username, submissionId);

    /* retrieve analysis step id */
    String analysisStep_id = ServletRequestUtils.getStringParameter(request, "id", null);
   
    request.getSession().setAttribute("analysisStep_id", analysisStep_id);

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("ANALYSIS Step ID = " + analysisStep_id + " study id = " + study_id);
    }

    List<String> uniqueAlgorithmDescriptions = getAnalysisStepService()
      .findUniqueAlgorithmDescriptions();

    AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
    analysisStepCommand.setUniqueAlgorithmDescriptions(uniqueAlgorithmDescriptions);

    if (TreebaseUtil.isEmpty(analysisStep_id)) {
      if (perm == TBPermission.WRITE) {
        LOGGER.info("setAuthorizationChecked(true)");
        setAuthorizationChecked(true);
        return analysisStepCommand;
      } else {
        LOGGER.info("setAuthorizationChecked(false)");
        setAuthorizationChecked(false);
        return null;
      }
    } else {
      AnalysisStep analysisStep = mAnalysisStepService.findByID(Long
        .parseLong(analysisStep_id));
      Long analysis_id = analysisStep.getAnalysis().getId();

      TBPermission perm2 = getAnalysisService().getPermission(username, analysis_id);
      if (perm2 == TBPermission.WRITE || perm2 == TBPermission.READ_ONLY
        || perm2 == TBPermission.SUBMITTED_WRITE) {

        BeanUtils.copyProperties(analysisStep, analysisStepCommand);
        Software software = analysisStep.getSoftwareInfo();
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

    // Check permission that the user has the edit right:
    // Currently it is not necessary since the only delete link can be hacked by direct editing
    // the url.
    // but the delete can only work with this particular study.
    TBPermission perm = getStudyService().getPermission(request.getRemoteUser(), study.getId());
    if (perm != TBPermission.WRITE) {
      // Give error message and return
      // return;
    }
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

 
  private boolean isSubmitter (long objectId,HttpServletRequest request) {
    Study study = ControllerUtil.findStudy(request, getStudyService());
    //Study study = getStudy(objectId,request);
    Submission submission = study.getSubmission();
    TBPermission tbp = getSubmissionService().getPermission(request.getRemoteUser(), submission.getId());
    if (tbp == TBPermission.WRITE || tbp == TBPermission.READ_ONLY || tbp == TBPermission.SUBMITTED_WRITE) {
      return true;
    }
    else {
      return false;
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

    // It can happen that the TBID is saved but the tree-block has been deleted
    // Or the only tree in the block has been removed.
    if (treeblock != null) {

      Long submission_id = getSubmissionHome().findByTreeBlock(treeblock).getId();
      TBPermission perm2 = getSubmissionService().getPermission(
        request.getRemoteUser(),
        submission_id);
      if (perm2 == TBPermission.WRITE || perm2 == TBPermission.SUBMITTED_WRITE) {
        LOGGER.info("setAuthorizationChecked(true)");
        setAuthorizationChecked(true);
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

      study = mStudyService.findBySubmissionID(Long.parseLong(submission_id));
    }

    if (!TreebaseUtil.isEmpty(submission_id)) {

      TBPermission perm2 = getSubmissionService().getPermission(
        username,
        Long.parseLong(submission_id));
      if (perm2 == TBPermission.WRITE || perm2 == TBPermission.READ_ONLY
        || perm2 == TBPermission.SUBMITTED_WRITE) {
        LOGGER.info("setAuthorizationChecked(true)");
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

        submissionId = sub.getId();
      }
    }

    // FIXME: move the method to studyService, handle the case study w/o submission
    TBPermission perm = getSubmissionService().getPermission(username, submissionId);

    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);
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

    String username = request.getRemoteUser();
    Long subId = (Long) command;

    if (request.getParameter(ACTION_SUBMIT) != null) {

      TBPermission perm2 = getSubmissionService().getPermission(username, subId);
      if (perm2 == TBPermission.WRITE) {
        getSubmissionService().updateStudyStatusReady(subId);
      } else {

        return setAttributeAndShowForm(
View Full Code Here

Examples of org.cipres.treebase.domain.admin.UserRole.TBPermission

    } else {
      study = mStudyService.findBySubmissionID(Long.parseLong(subid));
    }
    if (!TreebaseUtil.isEmpty(subid)) {

      TBPermission perm2 = getSubmissionService().getPermission(
        username,
        Long.parseLong(subid));
      if (perm2 == TBPermission.WRITE || perm2 == TBPermission.READ_ONLY
        || perm2 == TBPermission.SUBMITTED_WRITE) {
        LOGGER.info("setAuthorizationChecked(true)");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.