title: Firestore no permissions to execute operation
body: <p>I am trying to set up rules in Firestore where everyone can read from each other's content if they are authenticated into the application but only owners of documents can create, write, update or delete them. </p>
  
  <p>I have set up the following rules in Firestore:</p>
  
  <pre><code>rules_version = '2';
  
  service cloud.firestore {
    match /databases/{database} {
      match /codes/{userID} {
        allow create, write, update, delete: if request.auth.uid == userID;
        allow read: if request.auth.uid != null;
      }
    }
  }
  </code></pre>
  
  <p>My Firestore structure is:</p>
  
  <pre><code>Collection 'codes' &gt; Document 'BNhBibYZ0ThCNCH2gzPRufFsIk22' &gt; nothing in here
  </code></pre>
  
  <p>My request is:</p>
  
  <pre><code>firestore()
    .collection('codes')
    .doc(this.state.userID)
    .onSnapshot((querySnapshot) =&gt; {
      if (!querySnapshot) {
        let testObj = {"hello": "world"} 
        firestore().collection('codes').doc(this.state.userID).set(testObj);
      }
    });
  </code></pre>
  
  <p>The output I receive is: <code>Error: [firestore/permission-denied] The caller does not have permission to execute the specified operation.</code></p>
  
  <p>What am I doing wrong?</p>