Examples of canFork()


Examples of com.gitblit.models.UserModel.canFork()

      add(new ExternalLink("forkLink", "").setVisible(false));
      add(new ExternalLink("myForkLink", "").setVisible(false));
    } else {
      String fork = app().repositories().getFork(user.username, model.name);
      boolean hasFork = fork != null;
      boolean canFork = user.canFork(model);

      if (hasFork || !canFork) {
        // user not allowed to fork or fork already exists or repo forbids forking
        add(new ExternalLink("forkLink", "").setVisible(false));
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

      assertTrue("admin CAN NOT delete ref!", user.canDeleteRef(repository));
      assertTrue("admin CAN NOT rewind ref!", user.canRewindRef(repository));

      assertEquals("admin has wrong permission!", AccessPermission.REWIND, user.getRepositoryPermission(repository).permission);

      assertTrue("admin CAN NOT fork!", user.canFork(repository));

      assertTrue("admin CAN NOT delete!", user.canDelete(repository));
      assertTrue("admin CAN NOT edit!", user.canEdit(repository));
    }
  }
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertTrue("anonymous CAN NOT rewind ref!", user.canRewindRef(repository));

    assertEquals("anonymous has wrong permission!", AccessPermission.REWIND, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));

    assertFalse("anonymous CAN delete!", user.canDelete(repository));
    assertFalse("anonymous CAN edit!", user.canEdit(repository));
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertEquals("anonymous has wrong permission!", AccessPermission.REWIND, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));

    assertFalse("anonymous CAN delete!", user.canDelete(repository));
    assertFalse("anonymous CAN edit!", user.canEdit(repository));
  }
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertFalse("anonymous CAN rewind ref!", user.canRewindRef(repository));

    assertEquals("anonymous has wrong permission!", AccessPermission.CLONE, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  @Test
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertEquals("anonymous has wrong permission!", AccessPermission.CLONE, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  @Test
  public void testAnonymous_CLONE() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertFalse("anonymous CAN rewind ref!", user.canRewindRef(repository));

    assertEquals("anonymous has wrong permission!", AccessPermission.VIEW, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  @Test
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertEquals("anonymous has wrong permission!", AccessPermission.VIEW, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  @Test
  public void testAnonymous_VIEW() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertFalse("anonymous CAN rewind ref!", user.canRewindRef(repository));

    assertEquals("anonymous has wrong permission!", AccessPermission.NONE, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  /**
 
View Full Code Here

Examples of com.gitblit.models.UserModel.canFork()

    assertEquals("anonymous has wrong permission!", AccessPermission.NONE, user.getRepositoryPermission(repository).permission);

    repository.allowForks = false;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertFalse("anonymous CAN fork!", user.canFork(repository));
  }

  /**
   * Authenticated access rights/permissions
   */
 
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.