second to last commit hopefully final features and Ui refinements
This commit is contained in:
@@ -12,7 +12,7 @@ service cloud.firestore {
|
||||
request.resource.data.text is string &&
|
||||
request.resource.data.text.size() <= 240;
|
||||
|
||||
// the only update allowed is an echo
|
||||
// the only update allowed is an echo
|
||||
// echoCount and lastEchoAt fields can be changed
|
||||
// this prevents anyone from editing the text of someone else's message
|
||||
allow update: if
|
||||
@@ -23,6 +23,27 @@ service cloud.firestore {
|
||||
allow delete: if false;
|
||||
}
|
||||
|
||||
// --- "passport stamps" --------------------------------------------------
|
||||
// each anonymous-auth user has their own users/{uid}/stamps/{geohash4}
|
||||
// subcollection (see firebase/stamps.js) - request.auth.uid == userId
|
||||
// means a device can only ever read/write its OWN stamps, never anyone
|
||||
// else's. Stamps are permanent once earned: no update/delete from the
|
||||
// client, and create is validated the same way the messages create rule
|
||||
// above validates its fields.
|
||||
match /users/{userId}/stamps/{stampId} {
|
||||
allow read: if request.auth != null && request.auth.uid == userId;
|
||||
|
||||
allow create: if
|
||||
request.auth != null && request.auth.uid == userId &&
|
||||
request.resource.data.keys().hasAll(['geohash4', 'city', 'country', 'iconId', 'color', 'earnedAt']) &&
|
||||
request.resource.data.geohash4 is string &&
|
||||
request.resource.data.city is string &&
|
||||
request.resource.data.country is string;
|
||||
|
||||
allow update: if false;
|
||||
allow delete: if false;
|
||||
}
|
||||
|
||||
// --- global "memory counter" (GlobalCountPill) -------------------------
|
||||
// a single shared doc, meta/stats, holding totalMessagesEverPosted.
|
||||
// anyone can read it (it's shown to every visitor); writes are limited to
|
||||
|
||||
Reference in New Issue
Block a user