code: @Override
      public Collection<IPermissionTarget> searchTargets(String term) {
  
          // Initialize a new collection of matching targets.  We use a HashSet
          // implementation here to prevent duplicate target entries.
          Collection<IPermissionTarget> matching = new HashSet<IPermissionTarget>();
  
          /*
           * Attempt to find matching entities for each allowed entity type.
           * Any matching entities will be added to our collection.
           */
          for (TargetType targetType : allowedTargetTypes) {
              Set<JsonEntityBean> entities = groupListHelper.search(targetType.toString(), term);
              for (JsonEntityBean entity : entities) {
                  IPermissionTarget target =
                          new PermissionTargetImpl(entity.getId(), entity.getName(), targetType);
                  matching.add(target);
              }
          }
  
          if (IPermission.ALL_CATEGORIES_TARGET.contains(term)) {
              matching.add(ALL_CATEGORIES_TARGET);
          } else if (IPermission.ALL_PORTLETS_TARGET.contains(term)) {
              matching.add(ALL_PORTLETS_TARGET);
          } else if (IPermission.ALL_GROUPS_TARGET.contains(term)) {
              matching.add(ALL_GROUPS_TARGET);
          }
  
          // return the list of matching targets
          return matching;
      }
docs: /*
  (non-Javadoc)
  @see org.apereo.portal.permission.target.IPermissionTargetProvider#searchTargets(java.lang.String)