How to solve Uncaught (in promise) FirebaseError: Missing or insufficient permissions.

If you are integrating Firebase into your application. Then you will get permission-related issues. If you inspect your website in the console section, there you will get an error message and that message will be “Uncaught (in promise) FirebaseError: Missing or insufficient permissions. error message”. If you are also getting this type of error then don’t worry, this blog helps to solve the issue in the simplest way.

Figure: firestore permission error

Let’s solve it.

Step 1: Open your Firebase project and then click on the Firestore Database in the left drawer.
when you click on the Firestore database, you will set the collection of your project database.

Figure: Firebase dashboard

Step 2: If you see the top tabs, there you can see the Rules tab in the second tab. Click on the Rule tab. There you can see read-write permissions, where you need to replace line number 5 with the new condition.

Figure: Old Rules

Replace line number 5 with the code given below. The below code returns the true and allows read-write operations from your site.

Figure: New Rules

Now you can publish the new rules and refresh the site. Now, You will get a completely working website in front of you. You can see the example

Figure: List of data from cloud Firestore

I hope, this blog really helped you to fix your issue. if you have any queries or suggestions. You can connect with us through the contact section. We are also available on YouTube. Don’t forget to share and subscribe to us. Thank you for your valuable time. Have a nice day ahead.

Leave a Reply

Your email address will not be published. Required fields are marked *