manifold/firestore.rules
James Grugett 60f68b178d
Folds (#34)
* Fold type, fold page, query for fold contracts

* Tsconfig: target esnext, nounused locals: false

* Store tags in field on contract. Script to update contract tags

* Show tags on fold page

* Load all fold comments server-side to serve better feed

* Fix the annoying firebase already initialized error!

* Add links to /edit and /leaderboards for fold

* Page with list of folds

* UI for creating a fold

* Create a fold

* Edit fold page
2022-01-21 17:21:46 -06:00

43 lines
1008 B
Plaintext

rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read;
}
match /private-users/{userId} {
allow read: if resource.data.creatorId == request.auth.uid;
}
match /contracts/{contractId} {
allow read;
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;
}
match /contracts/{contractId}/bets/{betId} {
allow read;
}
match /{somePath=**}/bets/{betId} {
allow read;
}
match /contracts/{contractId}/comments/{commentId} {
allow read;
allow create: if request.auth != null;
}
match /{somePath=**}/comments/{commentId} {
allow read;
}
match /folds/{foldId} {
allow read;
allow update: if request.auth.uid == resource.data.curatorId;
}
}
}