title: Filter JSON response Java Spring - RESTful service
body: <p>I'm trying to hide certain fields in a GET based on whether or not a user is internal.</p>
  
  <p>Here is a snippet from my controller:</p>
  
  <pre><code>@RequestMapping(value = "rules", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public StandardJSON list(@ActiveUser ActiveUserId userId)
  {
      StandardJSON sj = new StandardJSON();
      sj.setErrors(new ArrayList&lt;String&gt;());
      sj.setData(service.listAllRules());
      return sj;
  }
  </code></pre>
  
  <p>The above returns the following JSON:</p>
  
  <pre><code>{
      "customerProfileId": "",
      "lastModifiedBy": "",
      "location": "",
      ...
  }
  </code></pre>
  
  <p>I can determine if a user is internal or not using a getIsInternalUser() method.</p>
  
  <p>How would I filter one of the json items if a user is external?</p>