# Firestore "Missing or insufficient permissions"

Source: https://vibe-fixer.com/guides/firestore-missing-or-insufficient-permissions
Last updated: 2026-11-16

**Short answer:** "Missing or insufficient permissions" means your Firestore security rules refused the request. Usually the visitor is not signed in yet, the user ID in the path does not match theirs, or a query asks for documents the rules do not allow. Fix the rule in Firestore Database, Rules, or change the query to match it.

## Key takeaways

- `Missing or insufficient permissions` means your Firestore security rules refused the request.
- Usually the visitor is not signed in yet, the user ID in the path does not match theirs, or a query asks for documents the rules do not allow.
- Fix the rule in Firestore Database, Rules, or change the query to match it.
- If the rules deny any document in the request, the whole request fails.
- After changing rules, allow up to a minute for new queries and up to ten minutes for active listeners.

This applies to apps that use Firebase and Cloud Firestore, including apps made with AI builders.

Login, emails or payments broke in your live app? Our AI agent fixes it in your code, then tests your live app again.

**Fixed in your code, then tested live.** [Check my app free](https://vibe-fixer.com/?src=guide-firestore-missing-or-insuffi-t#triageForm)

## Why does Firestore say "Missing or insufficient permissions"?

Every request to Firestore from a web or mobile app is checked against your security rules first. If the rules deny any document in the request, the whole request fails.

## What causes "Missing or insufficient permissions" in Firestore?

The causes on this page are rules that only allow signed-in users, a user ID that does not match the path, no rule covering the path, one denied document in a multi-document request, and rule changes that have not taken effect yet.

- The rules only allow signed-in users, and the visitor is signed out.
- The rules tie data to the user's ID, and the signed-in user's ID does not match the path the app reads or writes.
- No rule covers the path the app uses.
- One document in a multi-document request is not allowed, so the whole request is denied.
- The rules were changed recently and have not taken effect yet; Firebase says it can take up to a minute for new queries and up to ten minutes for active listeners.

## How to fix "Missing or insufficient permissions"

1. Open the Firebase console, then Firestore Database, then the Rules tab, and find the `match` block for the path in the error.
2. For data each user owns, a rule like this allows only the owner:

```
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, write: if request.auth != null && request.auth.uid == userId;
    }
  }
}
```

3. Make the app read the same path the rule allows, for example `doc(db, "users", auth.currentUser.uid)`, and run the query only after sign-in has finished (inside `onAuthStateChanged`), not on page load.
4. For queries, add the same condition to the query that the rule checks, such as `where("ownerId", "==", auth.currentUser.uid)`. Firebase says "security rules are not filters": a query that could return a document the user may not read is refused as a whole.
5. When creating or updating, check new values with `request.resource.data` (the incoming document) and existing values with `resource.data` (the stored one).
6. Test the rule in the Rules Playground on the Rules tab, with the same signed-in user and path, before publishing.
7. Never "fix" it with `allow read, write: if true;`. That opens your data to anyone.

Source: Firebase: Get started with Cloud Firestore Security Rules; Firebase: Securely query data.

## Why does Firestore work for me but refuse my customers?

You're signed in, your customers aren't. You test signed in as the owner, who the rules happen to allow. A different user, or a signed-out visitor, is judged by the same rules and may be refused.

## How do I check it is fixed?

1. Try the same action as a signed-out visitor and as a different signed-in user, not only as the owner.
2. Check that the rules cover the path the app reads or writes, and that the signed-in user's ID matches that path.
3. If you changed the rules recently, allow time for them to take effect: up to a minute for new queries and up to ten minutes for active listeners.
4. Check that the page, the save or the console no longer shows "Missing or insufficient permissions".

**Fixed in your code, then tested live.** [Check my app free](https://vibe-fixer.com/?src=guide-firestore-missing-or-insuffi-m#triageForm)

Related: [Who can fix my AI-built app?](https://vibe-fixer.com/guides/vibe-coding-expert) · [App fix price](https://vibe-fixer.com/pricing) · [Data won't save: "new row violates row-level security policy"](https://vibe-fixer.com/guides/data-wont-save-row-level-security) · [Users can see other users' data in my Lovable app](https://vibe-fixer.com/guides/users-can-see-other-users-data) · [My builder says the app is tested, but my customers hit problems](https://vibe-fixer.com/guides/add-vibefix-to-your-ai-tool)

VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.

Want it fixed for you? For any app whose code is on GitHub, whichever tool built it, VibeFix's AI agent can find the cause of this error, fix it in your code and re-check your live app. Start with a free check: https://vibe-fixer.com
