I have a lot of accounts inside a collection called Users and I want to prevent the deletion of the documents (accounts), How can I do it using rules security?
Also, I want to ask is it possible to prevent deleting any document inside Users collection via Firebase Console?
I don't need to delete any document never even by the admin
Edit Rules History
//Before pusblish the question
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
//Current
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /USERS/{userId} {
allow delete: if false;
}
}
}