Examples of canDelete()


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

      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.canDelete()

    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));
  }

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

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

    repository.allowForks = true;
    assertFalse("authenticated CAN fork!", user.canFork(repository));
    user.canFork = true;
    assertTrue("authenticated CAN NOT fork!", user.canFork(repository));

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

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

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

    user.canFork = true;
    assertFalse("named CAN fork!", user.canFork(repository));
    repository.allowForks = true;
    assertTrue("named CAN NOT fork!", user.canFork(repository));

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

  /**
   * PUSH_NONE = PUSH access restriction, NO access permission
View Full Code Here

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

    assertEquals("user has wrong permission!", AccessPermission.EXCLUDE, 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 testAdminTeamInheritance() throws Exception {
View Full Code Here

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

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

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

    assertFalse("owner CAN NOT delete!", user.canDelete(repository));
    assertTrue("owner CAN NOT edit!", user.canEdit(repository));

    // test personal repo owner
    UserModel jj = new UserModel("jj");
    assertFalse("jj SHOULD NOT HAVE a repository permission!", jj.hasRepositoryPermission(repository.name));
View Full Code Here

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

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

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

    assertTrue("jj CAN NOT delete!", jj.canDelete(repository));
    assertTrue("jj CAN NOT edit!", jj.canEdit(repository));
    assertTrue(repository.isOwner(jj.username));
  }

  @Test
View Full Code Here

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

    assertEquals("owner has wrong permission!", AccessPermission.REWIND, user2.getRepositoryPermission(repository).permission);

    assertTrue("owner CAN NOT fork!", user2.canFork(repository));

    assertFalse("owner CAN NOT delete!", user2.canDelete(repository));
    assertTrue("owner CAN NOT edit!", user2.canEdit(repository));

    assertTrue(repository.isOwner(user.username));
    assertTrue(repository.isOwner(user2.username));
View Full Code Here

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

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

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

    assertTrue("jj CAN NOT delete!", jj.canDelete(repository));
    assertTrue("jj CAN NOT edit!", jj.canEdit(repository));
    assertTrue(repository.isOwner(jj.username));
  }

  @Test
View Full Code Here

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

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

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

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

  @Test
  public void testVisitorPersonalRepository() 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.