Package org.sonar.server.exceptions

Examples of org.sonar.server.exceptions.ForbiddenException


    return user;
  }

  public void verifyCurrentUserCanReadFilter(DefaultIssueFilter issueFilter, String login) {
    if (!issueFilter.user().equals(login) && !issueFilter.shared()) {
      throw new ForbiddenException("User is not authorized to read this filter");
    }
  }
View Full Code Here


    }
  }

  private void verifyCurrentUserCanModifyFilter(DefaultIssueFilter issueFilter, String user) {
    if (!issueFilter.user().equals(user) && !isAdmin(user)) {
      throw new ForbiddenException("User is not authorized to modify this filter");
    }
  }
View Full Code Here

    }
  }

  private void verifyCurrentUserCanChangeFilterSharingFilter(DefaultIssueFilter issueFilter, IssueFilterDto existingFilterDto, String login) {
    if (existingFilterDto.isShared() != issueFilter.shared() && !existingFilterDto.getUserLogin().equals(login)) {
      throw new ForbiddenException("Only owner of a filter can change sharing");
    }
  }
View Full Code Here

    }
  }

  private void verifyCurrentUserCanChangeFilterOwnership(String user) {
    if (!isAdmin(user)) {
      throw new ForbiddenException("User is not authorized to change the owner of this filter");
    }
  }
View Full Code Here

    }
  }

  private void verifyCurrentUserCanShareFilter(DefaultIssueFilter issueFilter, String user) {
    if (issueFilter.shared() && !hasUserSharingPermission(user)) {
      throw new ForbiddenException("User cannot own this filter because of insufficient rights");
    }
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.exceptions.ForbiddenException

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.