title: POST request to Amazon Elastic Search from application impersonating user role (e.g. manager, contractor, etc...)
body: <p>I am working on a search microservice in Spring boot that relies on Amazon Elastic Search.</p>
  <ul>
  <li>I have an angular Front end and a spring boot service in front of Amazon Elastic Search</li>
  <li>I created <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/defining-roles.html#roles-application-priv" rel="nofollow noreferrer">Application Privileges</a> in Elastic search so that my service/application can impersonate three types of users: manager, employee, contractor;</li>
  <li>Each role is related to fine-grained permissions (e.g. only a manager can find personal data of the employees, Contractor can find employees but some fields would be scrubbed or not returned at all);</li>
  </ul>
  <p>My use case is the following:</p>
  <pre><code>GIVEN an authenticated user
     AND the user has been authorized with the role Contractor by an In-House access management system;
  WHEN the user searches through my service
  THEN only the relevant documents are shown as per his/her privileges;
  </code></pre>
  <p>How would that request (I guess POST) would look like for this to work?</p>