title: Allow Firebase Storage Bucket to be accessed only by some users
body: <p>I have a main "folder" in my storage directory called <code>users-projects</code> and then I create folders for every users' projects. I want to allow the users to access only their projects and the projects they are invited in, like a Dropbox or Google Drive folder with collaborators.</p>
  
  <p>In the Documentation they says: </p>
  
  <blockquote>
    <p>Include group information (such as a group ID or list of authorized
    uids) in the file metadata</p>
  </blockquote>
  
  <p>So here is my questions: </p>
  
  <ul>
  <li>Can I do this directly with the folder? </li>
  <li>How can I store the list of authorized uids?</li>
  </ul>
  
  <p>I am programming an iOS app in Swift.</p>
  
  <p>Here is my actual code for the Rules:</p>
  
  <pre><code>service firebase.storage {
    match /b/on-team.appspot.com/o {
      match /{allPaths=**} {
        allow read, write: if request.auth != null;
      }
      match /users-projects {
          match /{projectId} {
          allow read, write: if ?????
        }
      }
    }
  }
  </code></pre>
  
  <p>Here is the official documentation: <a href="https://firebase.google.com/docs/storage/security/user-security" rel="nofollow">https://firebase.google.com/docs/storage/security/user-security</a> .</p>