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:27:59 +00:00
|
|
|
allow update: if resource.data.creatorId == request.auth.uid && request.resource.data.keys().hasOnly(["description"]);
|
2022-01-06 03:04:10 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|