Firestore Security Rules Pro Tips (Save 90% Time) | Advanced Firebase/Firestore
Sam Fromaway Sam Fromaway
11.2K subscribers
5,489 views
134

 Published On Sep 17, 2020

Tool: https://code-snippet-generator1.netli...
Contribute To The Tool: https://github.com/samfromaway/code-g...

Github Repo With Code: https://github.com/samfromaway/fireba...
Documentation: https://firebase.google.com/docs/fire...

Last Video:    • Firestore Security Rules Setup | Adva...  
Full Firebase Playlist:    • Firebase  
Full React Firebase Playlist:    • React & Firebase  

COMMAND:
firebase deploy --only firestore:rules

Today we are going to learn how to implement firebase security rules for your real-world application. As you already know Firestore is a No-SQL database. I personally really like the flexibility that comes with that but on the other hand, everybody can technically write any kind of data with any kind of key-value pair. Of course our client app, in this case, our react application, has only a limited number of fields. But we know that clientside data can’t be trusted. And with some small tricks technically any hacker can write to your database with whatever he or she wants.

This is our school directory and we want to secure it this way:
- Everybody can read data
- Only logged in users can write so create, update, and delete data.
- The types must be correct.
- Only the owner of the respective data can update and delete the data.
- A document is just allowed to have the predefined keys.
- All keys are required to be in a document, only the description is optional.
- The score can only be between 0 and 10.
- Updates can only be done all 5s to reduce spamming

CONTACT:
📱 Facebook -   / devworldinfo  
🌎 Website - https://www.dev-world.info
📧 Email - [email protected]

ABOUT THIS CHANNEL:
Dev World is a mix of tutorials and educational videos around Coding, Online Marketing, and Design.

#Coding #Webdesign #Marketing

show more

Share/Embed