title: how to set permissions in firebase firestore
body: <pre><code>    $path = &quot;firebase_auth.json&quot;;
  
      $config = array(
          &quot;projectId&quot; =&gt; &quot;XXXX&quot;,
          &quot;keyFile&quot; =&gt; json_decode(file_get_contents($path), true)
      );
      $firestore = new FirestoreClient($config);
      $collectionReference = $firestore-&gt;collection('Channels');
      $snapshot = $collectionReference-&gt;documents().get();
  </code></pre>
  <p>Response of this code is</p>
  <blockquote>
  <p>An uncaught Exception was encountered</p>
  <p>Type: Google\Cloud\Core\Exception\ServiceException</p>
  <p>Message: { &quot;message&quot;: &quot;Missing or insufficient permissions.&quot;, &quot;code&quot;: 7, &quot;status&quot;: &quot;PERMISSION_DENIED&quot;, &quot;details&quot;: [] }</p>
  <p>Filename: /var/www/html/riglynx/vendor/google/cloud/Core/src/GrpcRequestWrapper.php</p>
  <p>Line Number: 263</p>
  </blockquote>