docs: @PreAuthorize(
              "hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))")
      @RequestMapping(value = "/permissions/{activity}/targets.json", method = RequestMethod.GET)
      public ModelAndView getTargets(
              @PathVariable("activity") Long activityId, @RequestParam("q") String query) {
  
          IPermissionActivity activity = permissionOwnerDao.getPermissionActivity(activityId);
          Collection<IPermissionTarget> targets = Collections.emptyList();
          if (activity != null) {
              IPermissionTargetProvider provider =
                      targetProviderRegistry.getTargetProvider(activity.getTargetProviderKey());
  
              SortedSet<IPermissionTarget> matchingTargets = new TreeSet<>();
              // add matching results for this identifier provider to the set
              targets = provider.searchTargets(query);
              for (IPermissionTarget target : targets) {
                  if ((StringUtils.isNotBlank(target.getName())
                                  && target.getName().toLowerCase().contains(query))
                          || target.getKey().toLowerCase().contains(query)) {
                      matchingTargets.addAll(targets);
                  }
              }
          }
          ModelAndView mv = new ModelAndView();
          mv.addObject("targets", targets);
          mv.setViewName("json");
  
          return mv;
      }