Package com.gitblit.Constants

Examples of com.gitblit.Constants.AccessPermission.atLeast()


    // http/https url
    if (settings.getBoolean(Keys.git.enableGitServlet, true)) {
      AccessPermission permission = user.getRepositoryPermission(repository).permission;
      if (permission.exceeds(AccessPermission.NONE)) {
        Transport transport = Transport.fromString(request.getScheme());
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(transport)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
        list.add(new RepositoryUrl(getRepositoryUrl(request, username, repository), permission));
View Full Code Here


    // ssh daemon url
    String sshDaemonUrl = servicesManager.getSshDaemonUrl(request, user, repository);
    if (!StringUtils.isEmpty(sshDaemonUrl)) {
      AccessPermission permission = user.getRepositoryPermission(repository).permission;
      if (permission.exceeds(AccessPermission.NONE)) {
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(Transport.SSH)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
View Full Code Here

    // git daemon url
    String gitDaemonUrl = servicesManager.getGitDaemonUrl(request, user, repository);
    if (!StringUtils.isEmpty(gitDaemonUrl)) {
      AccessPermission permission = servicesManager.getGitDaemonAccessPermission(user, repository);
      if (permission.exceeds(AccessPermission.NONE)) {
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(Transport.GIT)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
        list.add(new RepositoryUrl(gitDaemonUrl, permission));
View Full Code Here

  }

  public AccessPermission getGitDaemonAccessPermission(UserModel user, RepositoryModel repository) {
    if (gitDaemon != null && user.canClone(repository)) {
      AccessPermission gitDaemonPermission = user.getRepositoryPermission(repository).permission;
      if (gitDaemonPermission.atLeast(AccessPermission.CLONE)) {
        if (repository.accessRestriction.atLeast(AccessRestrictionType.CLONE)) {
          // can not authenticate clone via anonymous git protocol
          gitDaemonPermission = AccessPermission.NONE;
        } else if (repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) {
          // can not authenticate push via anonymous git protocol
View Full Code Here

    // http/https url
    if (settings.getBoolean(Keys.git.enableGitServlet, true)) {
      AccessPermission permission = user.getRepositoryPermission(repository).permission;
      if (permission.exceeds(AccessPermission.NONE)) {
        Transport transport = Transport.fromString(request.getScheme());
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(transport)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
        list.add(new RepositoryUrl(getRepositoryUrl(request, username, repository), permission));
View Full Code Here

    // ssh daemon url
    String sshDaemonUrl = servicesManager.getSshDaemonUrl(request, user, repository);
    if (!StringUtils.isEmpty(sshDaemonUrl)) {
      AccessPermission permission = user.getRepositoryPermission(repository).permission;
      if (permission.exceeds(AccessPermission.NONE)) {
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(Transport.SSH)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
View Full Code Here

    // git daemon url
    String gitDaemonUrl = servicesManager.getGitDaemonUrl(request, user, repository);
    if (!StringUtils.isEmpty(gitDaemonUrl)) {
      AccessPermission permission = servicesManager.getGitDaemonAccessPermission(user, repository);
      if (permission.exceeds(AccessPermission.NONE)) {
        if (permission.atLeast(AccessPermission.PUSH) && !acceptPush(Transport.GIT)) {
          // downgrade the repo permission for this transport
          // because it is not an acceptable PUSH transport
          permission = AccessPermission.CLONE;
        }
        list.add(new RepositoryUrl(gitDaemonUrl, permission));
View Full Code Here

  }

  public AccessPermission getGitDaemonAccessPermission(UserModel user, RepositoryModel repository) {
    if (gitDaemon != null && user.canClone(repository)) {
      AccessPermission gitDaemonPermission = user.getRepositoryPermission(repository).permission;
      if (gitDaemonPermission.atLeast(AccessPermission.CLONE)) {
        if (repository.accessRestriction.atLeast(AccessRestrictionType.CLONE)) {
          // can not authenticate clone via anonymous git protocol
          gitDaemonPermission = AccessPermission.NONE;
        } else if (repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) {
          // can not authenticate push via anonymous git protocol
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.