61 lines
1.6 KiB
Plaintext
61 lines
1.6 KiB
Plaintext
rules_version = '2';
|
|
|
|
// To deploy: `firebase deploy --only firestore:rules`
|
|
service cloud.firestore {
|
|
match /databases/{database}/documents {
|
|
|
|
function isAdmin() {
|
|
return request.auth.uid == 'igi2zGXsfxYPgB0DJTXVJVmwCOr2' // Austin
|
|
|| request.auth.uid == '5LZ4LgYuySdL1huCWe7bti02ghx2' // James
|
|
|| request.auth.uid == 'tlmGNz9kjXc2EteizMORes4qvWl2' // Stephen
|
|
|| request.auth.uid == 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // Manifold
|
|
}
|
|
|
|
match /users/{userId} {
|
|
allow read;
|
|
}
|
|
|
|
match /private-users/{userId} {
|
|
allow read: if resource.data.id == request.auth.uid || isAdmin();
|
|
}
|
|
|
|
match /contracts/{contractId} {
|
|
allow read;
|
|
allow update: if request.resource.data.diff(resource.data).affectedKeys()
|
|
.hasOnly(['description', 'tags', 'lowercaseTags']);
|
|
allow update: if isAdmin();
|
|
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, delete: if request.auth.uid == resource.data.curatorId;
|
|
}
|
|
|
|
match /folds/{foldId}/followers/{userId} {
|
|
allow read;
|
|
allow write: if request.auth.uid == userId;
|
|
}
|
|
|
|
match /{somePath=**}/followers/{userId} {
|
|
allow read;
|
|
}
|
|
}
|
|
} |