James Moger
2012-10-23 479cc28bdf743b778f9528bd0e9b997541aead53
src/com/gitblit/client/EditUserDialog.java
@@ -347,18 +347,35 @@
            restricted.add(repo.name);
         }
      }
      StringUtils.sortRepositorynames(restricted);
      List<String> list = new ArrayList<String>();
      // repositories
      list.add(".*");
      // all repositories excluding personal repositories
      list.add("[^~].*");
      String lastProject = null;
      for (String repo : restricted) {
         String projectPath = StringUtils.getFirstPathElement(repo);
         if (lastProject == null || !lastProject.equalsIgnoreCase(projectPath)) {
            lastProject = projectPath;
            if (!StringUtils.isEmpty(projectPath)) {
               // regex for all repositories within a project
               list.add(projectPath + "/.*");
            }
            list.add(repo);
         }
      }
      // remove repositories for which user already has a permission
      if (permissions == null) {
         permissions = new ArrayList<RegistrantAccessPermission>();
      } else {
         for (RegistrantAccessPermission rp : permissions) {
            restricted.remove(rp.registrant);
            list.remove(rp.registrant);
         }
      }
      StringUtils.sortRepositorynames(restricted);
      repositoryPalette.setObjects(restricted, permissions);
      repositoryPalette.setObjects(list, permissions);
   }
   public void setTeams(List<TeamModel> teams, List<TeamModel> selected) {