code: @PreAuthorize(
              "hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))")
      @RequestMapping(value = "/permissions/activities.json", method = RequestMethod.GET)
      public ModelAndView getActivities(@RequestParam(value = "q", required = false) String query) {
  
          if (StringUtils.isNotBlank(query)) {
              query = query.toLowerCase();
          }
  
          List<IPermissionActivity> activities = new ArrayList<>();
          Collection<IPermissionOwner> owners = permissionOwnerDao.getAllPermissionOwners();
  
          for (IPermissionOwner owner : owners) {
              for (IPermissionActivity activity : owner.getActivities()) {
                  if (StringUtils.isBlank(query)
                          || activity.getName().toLowerCase().contains(query)) {
                      activities.add(activity);
                  }
              }
          }
          Collections.sort(activities);
  
          ModelAndView mv = new ModelAndView();
          mv.addObject("activities", activities);
          mv.setViewName("json");
  
          return mv;
      }
docs: Provide a list of all registered IPermissionActivities. If an optional search string is
  provided, the returned list will be restricted to activities matching the query.