title: Firebase security rules "false for list" error
body: <p>I have a &quot;courses&quot; resource with different levels of access allowed to it.</p>
  <p>I have setup the following rules for it:</p>
  <pre><code>      allow read: 
        if
        isSuperAdmin() ||
        adminBelongsToWorkSpace(workspaceId) ||
        editorBelongsToWorkSpace(workspaceId) || 
        (canView(resource) || canEdit(resource)) &amp;&amp; belongsToWorkspace(workspaceId) ||
        allCanView(resource) &amp;&amp; belongsToWorkspace(workspaceId) ||
        isPublicAccess(resource) &amp;&amp; isPublished(resource);
  </code></pre>
  <p>The access levels basically dictate:</p>
  <ul>
  <li>Can access if you are a super admin</li>
  <li>Can access if you are an admin and belong to the workspace (all courses are under a workspace)</li>
  <li>Can access if you are an editor and belong to the workspace</li>
  <li>Can access if you your UID is inside an array &quot;canView&quot; OR &quot;canEdit&quot; and you belong to the workspace</li>
  <li>Can access if the course is public access and is published. (Meaning unauthenticated users)</li>
  </ul>
  <p>The way I build the query is this:</p>
  <pre><code>const ref = firestore
      .collection('workspaces')
      .doc(workspaceId)
      .collection('courses');
  
  
  let courses;
  let data;
  
  try {
      
      if (getAll) {
          data = await ref.get();
          
      } else {
          if (publicAccess) {
              ref.where('publicAccess', '==', true);
              ref.where('published', '==', true);
              
          }
  
          if (allCanView) {
              ref.where('published', '==', true);
              ref.where('allCanView', '==', true);
              
          }
  
          if (userId) {
              ref.where('published', '==', true);
              ref.where('allCanView', '==', true);
              ref.where('canView', 'array-contains', userId);
              ref.where('canEdit', 'array-contains', userId);
          
          }
  
          data = await ref.get();
      }
  </code></pre>
  <p>You can see that the documents I query are conditional upon boolean values such as publicAccess, allCanView and UserId (string). GetAll boolean is used in case the editor/admin/superadmin is trying to query, in which case you get everything.</p>
  <p>In the console I get this error, and I don't know how to process it:</p>
  <pre><code>FirebaseError: 
  false for 'list' @ L103
  </code></pre>
  <p>L103 - line 103, points to &quot;isSuperAdmin()&quot;, and this function is the following:</p>
  <pre><code>  function isSuperAdmin() {
      return isSignedIn() &amp;&amp; request.auth.token.superadmin == true;
    }
  </code></pre>
  <p><strong>UPDATE:</strong></p>
  <p>I tested the rules out on the rules playground and they work fine for fetching the data. So I am guessing it's the queries and how they're constructed that is the issue.</p>
  <p>The error occurs when the user is not an admin, just a user, but has his ID in the canView/canEdit arrays.</p>
  <p>But as far as I know this is correct:</p>
  <pre><code>            ref.where('canView', 'array-contains', userId);
              ref.where('canEdit', 'array-contains', userId);
  </code></pre>