Exemple #1
0
 public List<String> modifiableGroupsForUser(Username userName) {
   if (isUserAdmin(userName)) {
     return goConfigService.allGroups();
   }
   List<String> modifiableGroups = new ArrayList<String>();
   for (String group : goConfigService.allGroups()) {
     if (isUserAdminOfGroup(userName.getUsername(), group)) {
       modifiableGroups.add(group);
     }
   }
   return modifiableGroups;
 }
Exemple #2
0
 public List<CaseInsensitiveString> viewablePipelinesFor(Username username) {
   List<CaseInsensitiveString> pipelines = new ArrayList<CaseInsensitiveString>();
   for (String group : goConfigService.allGroups()) {
     if (hasViewPermissionForGroup(CaseInsensitiveString.str(username.getUsername()), group)) {
       pipelines.addAll(goConfigService.pipelines(group));
     }
   }
   return pipelines;
 }