title: Reading and writing in firestore only through cloud functions
body: <p>I want to set my Cloud Firestore database permissions so that no one will be able to read and write from it except through Cloud Functions.</p>
  
  <p>How can I do this?</p>
  
  <p>My guess (according with Firestore docs) is that I have to set the right condition for what I want, but what condition would it be? I don't know how to "communicate" the cloud function call with the rules.</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
      match /&lt;some_path&gt;/ {
        allow read, write: if &lt;some_condition&gt;;
      }
    }
  }
  </code></pre>