public List<String> getResourceList() { ArrayList<String> resources = new ArrayList<>(); for (Resource res : getCurrentConfig().getAllResources()) { resources.add(res.getName()); } return resources; }
public List<PackageDefinition> getPackages() { ArrayList<PackageDefinition> packages = new ArrayList<>(); for (PackageRepository repository : this.getCurrentConfig().getPackageRepositories()) { packages.addAll(repository.getPackages()); } return packages; }
private List<CaseInsensitiveString> getAuthorizedUsers(AdminsConfig authorizedAdmins) { ArrayList<CaseInsensitiveString> users = new ArrayList<>(); for (Admin admin : authorizedAdmins) { if (admin instanceof AdminRole) { addRoleUsers(users, admin.getName()); } else { users.add(admin.getName()); } } return users; }
private List<UserModel> allUsersForDisplay() { Collection<User> users = allUsers(); ArrayList<UserModel> userModels = new ArrayList<UserModel>(); for (User user : users) { String userName = user.getName(); ArrayList<String> roles = new ArrayList<String>(); for (Role role : goConfigService.rolesForUser(new CaseInsensitiveString(userName))) { roles.add(CaseInsensitiveString.str(role.getName())); } userModels.add( new UserModel( user, roles, securityService.isUserAdmin(new Username(new CaseInsensitiveString(userName))))); } return userModels; }