title: Modify firebase rules
body: <p>I am using this firebase rules:  </p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
  
      match /classes/{document=**} {
          allow read, write: if isSignedIn();
      }
  
      match /users/{userId}/{document=**} {
          allow read, write: if isSignedIn() &amp;&amp; request.auth.uid == userId || isSignedIn() &amp;&amp; hasPermission();
      }
    }
  
    function isSignedIn() {
      return request.auth.uid != null;
    }
  
    function hasPermission() {
      return request.auth.uid in resource.data.ruleList;
    }
  }  
  </code></pre>
  
  <p>The <code>rulesList</code> <code>contains</code> my user_uuid. If a user wants to manage his own documents it works. There the pat would be for example: <code>/users/32T9lJ5nSEZrhLgxul4goBcscqk2/...data</code>. But admins should read the data of other users too. And exactly that does not work. When the <code>ruleList</code> contains a user_uuid he should be able to read all data of every user. What I am doing wrong?<br>
  The following code gets the user user_uuids from a collection called "classes" and searches after the name of each user:  </p>
  
  <pre><code>db.collection("classes").doc(klasse).get().then(function(doc) {
      if (doc.exists) {
        const data = doc.data();
        const members = data.members;
  
        members.reduce((chain, el) =&gt; {
          return chain
          .then(() =&gt; db.collection("users").doc(el).collection("user_data").doc("u").get())
          .then(doc =&gt; {
            const data = doc.data();
            var member_name = data.name;
          })
      }, Promise.resolve()).then(console.log("finished"));
    } else {
      console.log("No such document!");
    }
  }).catch(function(error) {
    console.log("Error getting document:", error);
  });
  </code></pre>
  
  <p>It returns a warning caused by insufficient permission.<br>
  ~filip   </p>