James Moger
2012-10-22 ba54242b0d080475bbfce2ab559b3fcf2a513a5b
src/com/gitblit/models/TeamModel.java
@@ -27,6 +27,7 @@
import com.gitblit.Constants.AccessPermission;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.RegistrantType;
import com.gitblit.Constants.Unused;
/**
@@ -93,10 +94,10 @@
    * 
    * @return the team's list of permissions
    */
   public List<RepositoryAccessPermission> getRepositoryPermissions() {
      List<RepositoryAccessPermission> list = new ArrayList<RepositoryAccessPermission>();
   public List<RegistrantAccessPermission> getRepositoryPermissions() {
      List<RegistrantAccessPermission> list = new ArrayList<RegistrantAccessPermission>();
      for (Map.Entry<String, AccessPermission> entry : permissions.entrySet()) {
         list.add(new RepositoryAccessPermission(entry.getKey(), entry.getValue()));
         list.add(new RegistrantAccessPermission(entry.getKey(), entry.getValue(), true, RegistrantType.REPOSITORY));
      }
      Collections.sort(list);
      return list;
@@ -129,6 +130,18 @@
   }
   
   /**
    * Returns true if the team has an explicitly specified access permission for
    * this repository.
    *
    * @param name
    * @return if the team has an explicitly specified access permission
    */
   public boolean hasExplicitRepositoryPermission(String name) {
      String repository = AccessPermission.repositoryFromRole(name).toLowerCase();
      return permissions.containsKey(repository);
   }
   /**
    * Adds a repository permission to the team.
    * <p>
    * Role may be formatted as: