Examples of Study


Examples of uk.ac.bbsrc.tgac.miso.core.data.Study

  @RequestMapping(value = "/{studyId}", method = RequestMethod.GET)
  public ModelAndView setupForm(@PathVariable Long studyId,
                                ModelMap model) throws IOException {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Study study = requestManager.getStudyById(studyId);
      Project project;
      if (study != null) {
        if (!study.userCanRead(user)) {
          throw new SecurityException("Permission denied.");
        }
        project = study.getProject();
        model.put("formObj", study);
        model.put("project", project);
        model.put("study", study);
        model.put("title", "Study "+studyId);
      }
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.Study

  public ModelAndView setupForm(@PathVariable Long studyId,
                                @PathVariable Long projectId,
                                ModelMap model) throws IOException {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Study study = null;
      if (studyId == AbstractStudy.UNSAVED_ID) {
        study = dataObjectFactory.getStudy(user);
        model.put("title", "New Study");
      }
      else {
        study = requestManager.getStudyById(studyId);
        model.put("title", "Study "+studyId);
      }

      Project project = requestManager.getProjectById(projectId);
        model.addAttribute("project", project);
        study.setProject(project);
        if (Arrays.asList(user.getRoles()).contains("ROLE_TECH")) {
            SecurityProfile sp = new SecurityProfile(user);
            LimsUtils.inheritUsersAndGroups(study, project.getSecurityProfile());
            study.setSecurityProfile(sp);
        } else {
            study.inheritPermissions(project);
        }

        if (!study.userCanWrite(user)) {
        throw new SecurityException("Permission denied.");
      }
      model.put("formObj", study);
      model.put("study", study);
      model.put("owners", LimsSecurityUtils.getPotentialOwners(user, study, securityManager.listAllUsers()));
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.