Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.Organization


   * @return
   */
  @RequestMapping(method = RequestMethod.GET)
  public String index(Model model, HttpServletRequest request, int teamId) {
   
    Organization org = null;
    String teamName = null;
   
    if (teamId != 0) {
      org = organizationService.loadById(teamId);
      if (org != null && org.getName() != null) {
        teamName = org.getName();
      }
    }
   
    if (teamName == null) {
      teamName = "All";
View Full Code Here


        String result = checkKey(request, DETAIL);
        if (!result.equals(API_KEY_SUCCESS)) {
            return RestResponse.failure(result);
        }

        Organization org = organizationService.loadById(teamId);

        if (org == null) {
            log.warn("Team lookup failed for ID " + teamId + ".");
            return RestResponse.failure(LOOKUP_FAILED);
        } else {
View Full Code Here

        log.warn("The supplied URL was not formatted correctly.");
        return RestResponse.failure(CREATION_FAILED);
      }
    }
   
    Organization organization = organizationService.loadById(teamId);
   
    if (organization == null) {
      log.warn("Invalid Team ID.");
      return RestResponse.failure(CREATION_FAILED);
    }
View Full Code Here

    String result = checkKey(request, LOOKUP);
    if (!result.equals(API_KEY_SUCCESS)) {
      return RestResponse.failure(result);
    }

    Organization org = organizationService.loadByName(teamName);

    if (org == null) {
      log.warn("Team lookup failed for ID " + teamName + ".");
      return RestResponse.failure("No team found with name '" + teamName + "'");
    } else {
View Full Code Here

      return RestResponse.failure(result);
    }

    if (request.getParameter("name") != null) {
     
      Organization organization = new Organization();
      organization.setName(request.getParameter("name"));
     
      if (organizationService.isValidOrganization(organization)) {
        organizationService.saveOrUpdate(organization);
        log.info("Successfully created new Team.");
        return writeSuccessObjectWithView(organization, AllViews.RestViewTeam2_1.class);
View Full Code Here

    }   
    if (appName == null) {
      return failure(APPLICATION_LOOKUP_FAILED);
    }   
    log.info("Received REST request for Applications in team = " + teamName + ".");   
    Organization org = organizationService.loadByName(teamName);
    if (org == null) {
      log.warn(APPLICATION_LOOKUP_FAILED);
            return failure(APPLICATION_LOOKUP_FAILED);
    }
   
    int teamId = org.getId();
    Application application = applicationService.loadApplication(appName, teamId)
   
    if (application == null) {
      log.warn(APPLICATION_LOOKUP_FAILED);
            return failure(APPLICATION_LOOKUP_FAILED);
View Full Code Here

     
      if (organization.getName() == null || organization.getName().trim().isEmpty()) {
                return RestResponse.failure("Name cannot be blank.");
      }
     
      Organization databaseOrganization = organizationService.loadByName(organization.getName().trim());
      if (databaseOrganization != null && !databaseOrganization.getId().equals(organization.getId())) {
                return RestResponse.failure("That name is already taken.");
      }
     
      organizationService.saveOrUpdate(organization);
     
View Full Code Here

        if (ScanImportStatus.SUCCESSFUL_SCAN == returnValue.getScanCheckResult()) {
            Scan scan = scanMergeService.saveRemoteScanAndRun(myChannelId, fileName);

            if (scan != null) {
                Organization organization = organizationService.loadById(orgId);
                return success(organization);
            } else {
                return failure("Something went wrong while processing the scan.");
            }
        } else {
View Full Code Here

    private TagService tagService;

    @RequestMapping(method=RequestMethod.GET)
    public ModelAndView detail(@PathVariable("orgId") int orgId,
                               HttpServletRequest request) {
        Organization organization = organizationService.loadById(orgId);
        List<Application> apps = PermissionUtils.filterApps(organization);
        if (organization == null || !organization.isActive()) {
            log.warn(ResourceNotFoundException.getLogMessage("Organization", orgId));
            throw new ResourceNotFoundException();

        } else if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS,orgId,null) &&
                (apps == null || apps.size() == 0)) {
View Full Code Here

    @RequestMapping(value="/info", method=RequestMethod.GET)
    public @ResponseBody String getInfo(@PathVariable int orgId) throws IOException {
        final RestResponse<? extends Object> restResponse;

        Organization organization = organizationService.loadById(orgId);
        List<Application> apps = PermissionUtils.filterApps(organization);

        if (organization == null){
            restResponse = RestResponse.failure("Unable to find the requested team.");
        } else if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS, orgId, null) &&
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.Organization

Copyright © 2018 www.massapicom. 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.