Package com.gitblit.models

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


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

    assertFalse("user CAN fork!", user.canFork(repository));

    assertFalse("user CAN delete!", user.canDelete(repository));
    assertFalse("user CAN edit!", user.canEdit(repository));
  }

  @Test
  public void testRegexMatching() throws Exception {
View Full Code Here


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

    assertFalse("user CAN fork!", user.canFork(repository));

    assertFalse("user CAN delete!", user.canDelete(repository));
    assertFalse("user CAN edit!", user.canEdit(repository));
  }

  @Test
  public void testRegexIncludeCommonExcludePersonal() throws Exception {
View Full Code Here

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

    assertFalse("user CAN fork!", user.canFork(common));

    assertFalse("user CAN delete!", user.canDelete(common));
    assertFalse("user CAN edit!", user.canEdit(common));

    // personal
    RepositoryModel personal = new RepositoryModel("~ubercool/_my-r/e~po.git", null, null, new Date());
    personal.authorizationControl = AuthorizationControl.NAMED;
View Full Code Here

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

    assertFalse("user CAN fork!", user.canFork(personal));

    assertFalse("user CAN delete!", user.canDelete(personal));
    assertFalse("user CAN edit!", user.canEdit(personal));
  }

  @Test
  public void testRegexMatching2() throws Exception {
View Full Code Here

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

    assertFalse("user CAN fork!", user.canFork(personal));

    assertFalse("user CAN delete!", user.canDelete(personal));
    assertFalse("user CAN edit!", user.canEdit(personal));
  }

  @Test
  public void testRegexOrder() throws Exception {
View Full Code Here

    assertEquals("user has wrong permission!", AccessPermission.PUSH, user.getRepositoryPermission(personal).permission);

    assertFalse("user CAN fork!", user.canFork(personal));

    assertFalse("user CAN delete!", user.canDelete(personal));
    assertFalse("user CAN edit!", user.canEdit(personal));

    user.permissions.clear();
    user.setRepositoryPermission("~ubercool/.*", AccessPermission.CLONE);
    user.setRepositoryPermission(".*", AccessPermission.PUSH);
View Full Code Here

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

    assertFalse("user CAN fork!", user.canFork(personal));

    assertFalse("user CAN delete!", user.canDelete(personal));
    assertFalse("user CAN edit!", user.canEdit(personal));
  }

  @Test
  public void testExclusion() throws Exception {
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.