/** * Of the groups the user has selected, return only those the current user has permission to edit. * * @return those {@link Group Groups}. */ public List<Group> getSelectedGroupsUserHasPermToSee() { if (selectedGroupsStr == null) { return new ArrayList(); } if (selectedGroups == null) { ArrayList<Group> selectedGroupsHolder = new ArrayList<Group>(); for (String groupName : selectedGroupsStr) { Group group = groupManager.getGroup(groupName); if (group != null) { selectedGroupsHolder.add(group); } } selectedGroups = globalPermissionGroupAssociationUtil.getGroupsModifiableByCurrentUser( getLoggedInUser(), selectedGroupsHolder); } return selectedGroups; }
/** gets all the groups, used to populate the groups select list */ public Collection<Group> getAllVisibleGroups() { return globalPermissionGroupAssociationUtil.getGroupsModifiableByCurrentUser( getLoggedInUser(), new ArrayList(groupManager.getAllGroups())); }