Skip to content

Commit

Permalink
SAK-40293 REST service of polls my.json return an empty list (sakaipr…
Browse files Browse the repository at this point in the history
…oject#5806)

* Updated PollListManagerImp.java

* Updated PollListManagerImp.java

* SAK-40293 cleaned up the spacing
  • Loading branch information
maramar7 authored and ern committed Jul 24, 2018
1 parent 08d7841 commit d452592
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ public List<Poll> findAllPollsForUserAndSitesAndPermission(String userId, String
List<Poll> polls = null;
// get all allowed sites for this user
List<String> allowedSites = externalLogic.getSitesForUser(userId, permissionConstant);

if(siteIds!=null && siteIds.length>0 && !allowedSites.isEmpty()){
List<String> requestedSiteIds = Arrays.asList(siteIds);
// filter down to just the requested ones
allowedSites.retainAll(requestedSiteIds);
if(allowedSites.isEmpty()){
if (allowedSites.isEmpty()) {
// no sites to search so EXIT here
return new ArrayList<Poll>();
return new ArrayList<>();
} else {
if (siteIds != null && siteIds.length > 0) {
List<String> requestedSiteIds = Arrays.asList(siteIds);
// filter down to just the requested ones
allowedSites.retainAll(requestedSiteIds);
}
String[] siteIdsToSearch = allowedSites.toArray(new String[allowedSites.size()]);
String[] siteIdsToSearch = allowedSites.toArray(new String[0]);
Search search = new Search();
if (siteIdsToSearch.length > 0) {
search.addRestriction(new Restriction("siteId", siteIdsToSearch));
Expand Down

0 comments on commit d452592

Please sign in to comment.