title: Uncaught Error in snapshot listener: FirebaseError: Missing or insufficient permissions
body: <p><strong>I'm trying get data of posts  displayed from firebase by using onSnapshot listener but its showing this Firebase Error. Could someone help with this error</strong></p>
  <p><strong>App.js:</strong></p>
  <pre><code>import { useState, useEffect } from 'react';
  import './App.css';
  import loggo from './icons/loggo.svg';
  import Post from './Components/Post.js';
  import { db } from './firebase';
  
  function App() {
    const [posts, setPosts] = useState([]);
    useEffect(() =&gt; {
      db.collection('posts').onSnapshot(snapshot =&gt; {
        setPosts(snapshot.docs.map(doc =&gt; doc.data()));
      })
    }, []);
  
    return (
      &lt;div className=&quot;App&quot;&gt;
        &lt;div className=&quot;app_header&quot;&gt;
          &lt;img className=&quot;header_Image&quot; src={loggo} alt=&quot;insta&quot; /&gt;
        &lt;/div&gt;
        {
          posts.map(post =&gt; (
            &lt;Post username={post.username} caption={post.caption} imageUrl={post.imageUrl} /&gt;
          ))
        }
      &lt;/div &gt;
    );
  }
  export default App;
  </code></pre>