manifold/firestore.rules

36 lines
824 B
Plaintext
Raw Normal View History

2022-01-05 17:42:43 +00:00
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read;
allow create: if request.auth != null;
}
match /contracts/{contractId} {
allow read;
2022-01-07 19:47:55 +00:00
allow update: if resource.data.creatorId == request.auth.uid && request.resource.data.diff(resource.data).affectedKeys()
.hasOnly(['description']);
allow delete: if resource.data.creatorId == request.auth.uid;
2022-01-05 17:42:43 +00:00
}
2022-01-05 22:52:54 +00:00
match /contracts/{contractId}/bets/{betId} {
2022-01-05 17:42:43 +00:00
allow read;
}
2022-01-05 17:47:39 +00:00
match /{somePath=**}/bets/{betId} {
allow read;
}
2022-01-05 22:52:54 +00:00
match /contracts/{contractId}/comments/{commentId} {
2022-01-05 17:42:43 +00:00
allow read;
allow create: if request.auth != null;
}
2022-01-05 22:52:54 +00:00
match /{somePath=**}/comments/{commentId} {
allow read;
}
2022-01-05 17:42:43 +00:00
}
}