I’m building a web app where users sign in with a Firebase Authentication custom token. The token has claims like this:{ "iss": "------", "sub": "------", ...
I am building a Flutter mobile app using Firebase backend. I have four collections: institutions, resources, resourceTypes, users.I want the institution's collection to be accessible by any user (...
I have a collection named "dms" that has "firstUserId" and "secondUserId" as fields in its documents. The following rule is giving me permission denied error:match /dms/{...
I'm trying to use the diff() method in my Firestore rules to ensure the user only edits the allowed fields, however when I try to compile my rules and upload them, I receive the following error in my ...
In the Realtime Database, if we want to block all writes to an entire Realtime Database database based on some boolean contained therein, what is the proper way to do it?Let's say in Realtime ...
Previously, I had the following rule: allow read: if request.auth.token.email in resource.data.shareWith;Now, that the data structure changed and shareWith is no longer an array of email addresses, ...
Problem ContextI'm building a Firebase iOS app application where authenticated users can access their own documents. Each user has a dedicated document in Firestore with security rules like:match /...
Goal/intentionThe rule should grant access to a user document (which contains some personal information like email address) and also its subcollections for movie and tv watchlists, in case the user ...
I have the following rules in Cloud Firestore:match /users/{userId}/{documents=**} { allow read: if request.auth.token.email in resource.data.shareWith; // allow read: if resource.data.test == ...
These are all the rules I'm currently using:rules_version = '2';service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read: if request.auth != null; ...
I have a collection of musics. They can contain a subcollection of notes.I would like to prevent deletion if any notes existsI triedmatch /databases/{database}/documents { match /musics/{musicId} {...
I have a simple program to show real-time postview counts. But in Firebase, it saysYour security rules are defined as public, so anyone can steal, modify, or delete data in your databaseEvery ...
I am new to firebase and would like to know if it's possible to write different set of rules for different apps that have access to same firebase database.For example:Users of App A should be able ...