Package com.gitblit.models

Examples of com.gitblit.models.TeamModel


  public void testTeamMember_NONE_CREATE() 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.CREATE);
    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_CREATE() 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.CREATE);
    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_CREATE() 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.CREATE);
    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_CREATE() 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.CREATE);
    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_DELETE() 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.DELETE);
    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_DELETE() 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.DELETE);
    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_DELETE() 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.DELETE);
    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_DELETE() 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.DELETE);
    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_REWIND() 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.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_PUSH_REWIND() 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.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

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.