title: In Firebase storage, can I use db "get" rules?
body: <p>I'm trying to secure my Firebase (google cloud storage) files based on user data. In firestore, I use a rule based on getting database content (look up the uid in users table and match a field) and that's working fine. I'm trying to use the same kind of rules in firebase storage but in the simulator I get <code>Error: simulator.rules line [12], column [17]. Function not found error: Name: [get].; Error: Invalid argument provided to call. Function: [get], Argument: ["||invalid_argument||"]</code>. My rules look like this:</p>
  
  <pre><code>  match /b/{bucket}/o {
      function isAuth() {
        return request.auth != null &amp;&amp; request.auth.uid != null
      }
      function isAdmin() {
        return isAuth() &amp;&amp;
        "admin" in get(/databases/$(database)/documents/users/$(request.auth.uid)).data.roles;
      }
      function clientMatch(client) { // expects user's "client" field to be ID of client
        return isAuth() &amp;&amp;
        client == get(/databases/$(database)/documents/users/$(request.auth.uid)).data.client;
      }
      match /P/Clients/{client}/{allPaths=**} {
        allow read, write: if isAdmin() || clientMatch(client);
      }
    }
  }
  </code></pre>
  
  <p>Line 12 is the one beginning <code>client == get</code>, in <code>clientMatch()</code>.
  I haven't been able to tell whether these functions are only supported for Firestore (db) rules, or whether they should work for storage as well. </p>
  
  <p>If this doesn't work, what are my options? How do people look up user data for Firebase storage security?</p>