Package com.gitblit.models

Examples of com.gitblit.models.TeamModel


  public void testTeamMember_CLONE_REWIND() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.CLONE;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.REWIND);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here


  public void testTeamMember_VIEW_REWIND() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.VIEW;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.REWIND);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_NONE_CLONE() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.NONE;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.CLONE);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_PUSH_CLONE() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.PUSH;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.CLONE);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_CLONE_CLONE() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.CLONE;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.CLONE);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_VIEW_CLONE() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.VIEW;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.CLONE);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_NONE_VIEW() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.NONE;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.VIEW);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_PUSH_VIEW() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.PUSH;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.VIEW);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertTrue("team member CAN NOT clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_CLONE_VIEW() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.CLONE;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.VIEW);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertFalse("team member CAN clone!", user.canClone(repository));
View Full Code Here

  public void testTeamMember_VIEW_VIEW() throws Exception {
    RepositoryModel repository = new RepositoryModel("myrepo.git", null, null, new Date());
    repository.authorizationControl = AuthorizationControl.NAMED;
    repository.accessRestriction = AccessRestrictionType.VIEW;

    TeamModel team = new TeamModel("test");
    team.setRepositoryPermission(repository.name, AccessPermission.VIEW);
    UserModel user = new UserModel("test");
    user.teams.add(team);

    assertTrue("team member CAN NOT view!", user.canView(repository));
    assertFalse("team member CAN clone!", user.canClone(repository));
View Full Code Here

TOP

Related Classes of com.gitblit.models.TeamModel

Copyright © 2018 www.massapicom. 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.