@ PreAuthorize ( "hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))" ) @ RequestMapping ( value = "/permissions/principals.json" , method = RequestMethod . GET ) public ModelAndView getPrincipals ( @ RequestParam ( value = "q" ) String query , HttpServletRequest request , HttpServletResponse response ) throws Exception { /* * Add groups and people matching the search query to the JSON model */ ModelAndView mv = new ModelAndView ( ) ; List < JsonEntityBean > groups = new ArrayList < JsonEntityBean > ( ) ; groups . addAll ( listHelper . search ( EntityEnum . GROUP . toString ( ) , query ) ) ; Collections . sort ( groups ) ; mv . addObject ( "groups" , groups ) ; List < JsonEntityBean > people = new ArrayList < JsonEntityBean > ( ) ; people . addAll ( listHelper . search ( EntityEnum . PERSON . toString ( ) , query ) ) ; Collections . sort ( people ) ; mv . addObject ( "people" , people ) ; mv . setViewName ( "json" ) ; return mv ; }
Return a JSON view of the uPortal principals matching the supplied query string .