title: PERMISSION DENIED (grpc_status :7) when accessing Firestore
body: <p>I'm having some trouble accessing my firestore data via the python API. I've tried all the solutions that are mentioned in the other answers, but I still keep getting the same permission denied issue:</p>
  <pre><code>_InactiveRpcError: &lt;_InactiveRpcError of RPC that terminated with:
      status = StatusCode.PERMISSION_DENIED
      details = &quot;Missing or insufficient permissions.&quot;
      debug_error_string = &quot;{&quot;created&quot;:&quot;@1636057424.408000000&quot;,&quot;description&quot;:&quot;Error received from peer ipv4:x:x:x:x:443&quot;,&quot;file&quot;:&quot;src/core/lib/surface/call.cc&quot;,&quot;file_line&quot;:1068,&quot;grpc_message&quot;:&quot;Missing or insufficient permissions.&quot;,&quot;grpc_status&quot;:7}&quot;
  &gt;
  </code></pre>
  <p>Here's how I'm using the API:</p>
  <pre><code>import firebase_admin
  from firebase_admin import credentials
  from firebase_admin import firestore
  
  
  cred = credentials.Certificate('/users/88232/cred.json') #correct credentials path - also tried pasting the dictionary directly
  firebase_admin.initialize_app(cred)
  db = firestore.Client('myapp') #made sure it's the right project's name (I have multiple projects)
  doc_ref = db.collection(u'sample').document(u'0SZxt2xXs7n8Vglz8wEu')
  doc = doc_ref.get() #error here
  </code></pre>
  <p>Things I've tried:</p>
  <ul>
  <li>Use the service account credentials from firebase console in the API [<a href="https://stackoverflow.com/questions/63551206/403-missing-or-insufficient-permissions-python-firestore-client">1</a>]</li>
  <li>Include data store owner as part of roles when creating a new service account and using these credentials in the API [<a href="https://stackoverflow.com/questions/58068277/gcp-firestore-python-credentials">2</a>]</li>
  <li>Made sure Rules say <code>allow read, write: if true;</code> [<a href="https://stackoverflow.com/questions/46590155/firestore-permission-denied-missing-or-insufficient-permissions">3</a>]</li>
  </ul>
  <p>I'm not sure what else to try. Can someone please let me know if I have missed something?</p>
  <p><a href="https://i.stack.imgur.com/5nX1M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5nX1M.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/roX1U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/roX1U.png" alt="enter image description here" /></a></p>