/** * Can the user read from this CategoryOptionGroupSet (COGS)? * * <p>If the COGS is null, then the user must have no dimension constraints. (In other words, the * user must be able to read across all category option groups.) * * <p>If the COGS is not null, then the user must be able to read at least one category option * group from the category option group set. * * @param cogs The category option group set to test * @return true if user can read at least one category option group. */ private boolean canReadCOGS(User user, CategoryOptionGroupSet cogs) { if (cogs == null) { UserCredentials userCredentials = user.getUserCredentials(); return CollectionUtils.isEmpty(userCredentials.getCogsDimensionConstraints()) && CollectionUtils.isEmpty(userCredentials.getCatDimensionConstraints()); } return !CollectionUtils.isEmpty(categoryService.getCategoryOptionGroups(cogs)); }