Examples of controlForRef()


Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

        if (ref.isSymbolic()) {
          // A symbolic reference to another branch, instead of
          // showing the resolved value, show the name it references.
          //
          String target = ref.getTarget().getName();
          RefControl targetRefControl = pctl.controlForRef(target);
          if (!targetRefControl.isVisible()) {
            continue;
          }
          if (target.startsWith(Constants.R_HEADS)) {
            target = target.substring(Constants.R_HEADS.length());
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

            branches.add(b);
          }
          continue;
        }

        final RefControl refControl = pctl.controlForRef(ref.getName());
        if (refControl.isVisible()) {
          if (ref.getName().startsWith(Constants.R_HEADS)) {
            branches.add(createBranch(ref, refControl, targets));
          } else if (GitRepositoryManager.REF_CONFIG.equals(ref.getName())) {
            configBranch = createBranch(ref, refControl, targets);
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

    if (MagicBranch.isMagicBranch(refname)) {
      throw new BranchCreationNotAllowedException(refname);
    }

    final Branch.NameKey name = new Branch.NameKey(projectName, refname);
    final RefControl refControl = projectControl.controlForRef(name);
    final Repository repo = repoManager.openRepository(projectName);
    try {
      final ObjectId revid = parseStartingRevision(repo);
      final RevWalk rw = verifyConnected(repo, revid);
      RevObject object = rw.parseAny(revid);
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

    while (branchIt.hasNext()) {
      final Branch.NameKey k = branchIt.next();
      if (!projectName.equals(k.getParentKey())) {
        throw new IllegalArgumentException("All keys must be from same project");
      }
      if (!projectControl.controlForRef(k).canDelete()) {
        throw new IllegalStateException("Cannot delete " + k.getShortName());
      }

      if (db.changes().byBranchOpenAll(k).iterator().hasNext()) {
        branchIt.remove();
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

            continue;
          }
          replace(config, toDelete, section);

        } else if (AccessSection.isValid(name)) {
          if (checkIfOwner && !projectControl.controlForRef(name).isOwner()) {
            continue;
          }

          RefControl.validateRefPattern(name);
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

        if (AccessSection.GLOBAL_CAPABILITIES.equals(name)) {
          if (!checkIfOwner || projectControl.isOwner()) {
            config.remove(config.getAccessSection(name));
          }

        } else if (!checkIfOwner ||  projectControl.controlForRef(name).isOwner()) {
          config.remove(config.getAccessSection(name));
        }
      }

      if (message != null && !message.isEmpty()) {
View Full Code Here

Examples of com.google.gerrit.server.project.ProjectControl.controlForRef()

        final ProjectState pe = projectCache.get(branchName.getParentKey());
        if (pe == null) {
          return false;
        }
        final ProjectControl pc = pe.controlFor(user);
        return pc.controlForRef(branchName).isVisible();
    }

    /**
     * Create an ApprovalAttribute for the given approval suitable for serialization to JSON.
     * @param approval
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.