I've been unable to find anything in the docs that say whether you can add comments, i.e.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
// Testing the removal of this line:
// allow read: if true;
allow read: if false;
allow write: if request.auth.uid != null;
}
}
}
Is there any info online about the rules syntax? What language is it written in?
Edit and update your rulesOpen the Firebase console and select your project. Then, select Realtime Database, Cloud Firestore or Storage from the product navigation, then click Rules to navigate to the Rules editor. Edit your rules directly in the editor.
Use the Firebase console To set up and deploy your first set of rules, open the Rules tab in the Cloud Firestore section of the Firebase console. Write your rules in the online editor, then click Publish.
In Realtime Database, Firebase Security Rules consist of JavaScript-like expressions contained in a JSON document.
Go to Firebase, and sign up for a Google account. If you don't have one, then click “Get Started”. Click on “Add Project” to add a new project. Add a name for your project, and click “Create a project”.
The language is documented here. It's called CEL (common expression language). It's pretty clear from what you see that lines containing //
are considered like C++ and Java to be comments from the point of //
to the end of the line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With