Package com.gitblit.models

Examples of com.gitblit.models.RegistrantAccessPermission


    assertTrue(RpcUtils.createUser(testMember, url, account, password.toCharArray()));

    List<RegistrantAccessPermission> permissions = RpcUtils.getRepositoryMemberPermissions(retrievedRepository, url, account,
        password.toCharArray());
    assertEquals("Unexpected permissions! " + permissions.toString(), 1, permissions.size());
    permissions.add(new RegistrantAccessPermission(testMember.username, AccessPermission.VIEW, PermissionType.EXPLICIT, RegistrantType.USER, null, true));
    assertTrue(
        "Failed to set member permissions!",
        RpcUtils.setRepositoryMemberPermissions(retrievedRepository, permissions, url, account,
            password.toCharArray()));
    permissions = RpcUtils.getRepositoryMemberPermissions(retrievedRepository, url, account,
View Full Code Here


    assertTrue(helloworldTeams.contains(aTeam.name));

    // set no teams
    List<RegistrantAccessPermission> permissions = new ArrayList<RegistrantAccessPermission>();
    for (String team : helloworldTeams) {
      permissions.add(new RegistrantAccessPermission(team, AccessPermission.NONE, PermissionType.EXPLICIT, RegistrantType.TEAM, null, true));
    }
    assertTrue(RpcUtils.setRepositoryTeamPermissions(helloworld, permissions, url, account,
        password.toCharArray()));
    helloworldTeams = RpcUtils.getRepositoryTeams(helloworld, url, account,
        password.toCharArray());
View Full Code Here

    // TODO reconsider ownership as a user property
    // manually specify personal repository ownerships
    for (RepositoryModel rm : allRepositories) {
      if (rm.isUsersPersonalRepository(user.username) || rm.isOwner(user.username)) {
        RegistrantAccessPermission rp = new RegistrantAccessPermission(rm.name, AccessPermission.REWIND,
            PermissionType.OWNER, RegistrantType.REPOSITORY, null, false);
        // user may be owner of a repository to which they've inherited
        // a team permission, replace any existing perm with owner perm
        set.remove(rp);
        set.add(rp);
View Full Code Here

      // no permissions needed, REWIND for authenticated!
      return list;
    }
    // NAMED users and teams
    for (UserModel user : allUsers) {
      RegistrantAccessPermission ap = user.getRepositoryPermission(repository);
      if (ap.permission.exceeds(AccessPermission.NONE)) {
        list.add(ap);
      }
    }
    return list;
View Full Code Here

  }

  public List<RegistrantAccessPermission> getTeamAccessPermissions(RepositoryModel repository) {
    List<RegistrantAccessPermission> list = new ArrayList<RegistrantAccessPermission>();
    for (TeamModel team : allTeams) {
      RegistrantAccessPermission ap = team.getRepositoryPermission(repository);
      if (ap.permission.exceeds(AccessPermission.NONE)) {
        list.add(ap);
      }
    }
    Collections.sort(list);
View Full Code Here

    // TODO reconsider ownership as a user property
    // manually specify personal repository ownerships
    for (RepositoryModel rm : repositoryListCache.values()) {
      if (rm.isUsersPersonalRepository(user.username) || rm.isOwner(user.username)) {
        RegistrantAccessPermission rp = new RegistrantAccessPermission(rm.name, AccessPermission.REWIND,
            PermissionType.OWNER, RegistrantType.REPOSITORY, null, false);
        // user may be owner of a repository to which they've inherited
        // a team permission, replace any existing perm with owner perm
        set.remove(rp);
        set.add(rp);
View Full Code Here

      // no permissions needed, REWIND for authenticated!
      return list;
    }
    // NAMED users and teams
    for (UserModel user : userManager.getAllUsers()) {
      RegistrantAccessPermission ap = user.getRepositoryPermission(repository);
      if (ap.permission.exceeds(AccessPermission.NONE)) {
        list.add(ap);
      }
    }
    return list;
View Full Code Here

   */
  @Override
  public List<RegistrantAccessPermission> getTeamAccessPermissions(RepositoryModel repository) {
    List<RegistrantAccessPermission> list = new ArrayList<RegistrantAccessPermission>();
    for (TeamModel team : userManager.getAllTeams()) {
      RegistrantAccessPermission ap = team.getRepositoryPermission(repository);
      if (ap.permission.exceeds(AccessPermission.NONE)) {
        list.add(ap);
      }
    }
    Collections.sort(list);
View Full Code Here

    return false;
  }

  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {
    RegistrantAccessPermission rp = permissions.get(rowIndex);
    Columns col = Columns.values()[columnIndex];
    switch (col) {
    case Registrant:
      return rp.registrant;
    case Type:
View Full Code Here

    return null;
  }

  @Override
  public void setValueAt(Object o, int rowIndex, int columnIndex) {
    RegistrantAccessPermission rp = permissions.get(rowIndex);
    if (columnIndex == Columns.Permission.ordinal()) {
      rp.permission = (AccessPermission) o;
    }
  }
View Full Code Here

TOP

Related Classes of com.gitblit.models.RegistrantAccessPermission

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.