by kfarr · 2y ago · 0 comments
```
// Allow create new object if user is authenticated
allow create: if request.auth != null;
// Allow update or delete document if user is owner of document
allow update, delete: if request.auth.uid == resource.data.ownerUID
```
Which then leads me to the next question, what is the practical way to write rules against that operation?
But as expected, you can validate the incoming data as well https://firebase.google.com/docs/firestore/security/rules-co... but this would need to be done for any attribute that might lead to a change of ownership.
allow read, update, delete: if request.auth != null && request.auth.uid == userId;