title: How to pass extra auth parameters for firestore rules authentication (React-Native)?
body: <p>I want to implement role based restrictions in my application. I have the user role information in one collection documents. Now I want to write rules to restrict different Write, Update operation on other collections of the database.</p>
  
  <p>Since I am using Firestore database with React-Native I only pass the respective collection's document info while inserting/updating. So how can I  pass the user's role information along with this so that my rule gets authenticated and that data doesn't go into other collection.</p>
  
  <p>One example depicting above scenario:</p>
  
  <pre><code>/collection1/document1
  {
     prop1: value1,
     prop2: value2,
     role: "WRITE"
  }
  
  /collection1/document2
  {
     prop1: value1,
     prop2: value2,
     role: "READ"
  }
  </code></pre>
  
  <p>Now consider that current logged in user is <code>document2</code>.</p>
  
  <p>I have another collection:</p>
  
  <pre><code>/collection2/doc1
  {
     userRef: document1, //this is id of document1 from collection1
     ...
  }
  </code></pre>
  
  <p>I want to configure firestore rule for collection2 that if request has come from user with <code>role="WRITE"</code> then only allow it to isert/update documents.</p>
  
  <p>Have read many articles and ways but any of them does not satisfy this use-case.</p>
  
  <p>Any help would be appreciated.</p>