-
Notifications
You must be signed in to change notification settings - Fork 6
/
firestore.rules
32 lines (32 loc) · 1.22 KB
/
firestore.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /keysets/{keyset} {
allow read;
allow create, update: if request.auth.token.editor == true && request.auth.uid == request.resource.data.latestEditor || request.auth.token.designer == true && request.auth.token.nickname in request.resource.data.designer && request.auth.uid == request.resource.data.latestEditor;
allow delete: if request.auth.token.editor == true;
}
match /users/{userId} {
allow read, update: if request.auth != null && request.auth.uid == userId;
allow create: if request.auth != null;
allow delete: if request.auth != null && request.auth.uid == userId || request.auth.token.admin == true;
}
match /changelog/{action} {
allow read, delete: if request.auth.token.admin == true;
allow create: if false;
allow update: if false;
}
match /updates/{update} {
allow read;
allow write: if request.auth.token.admin == true;
}
match /guides/{guide} {
allow read;
allow write: if request.auth.token.admin == true;
}
match /app/{appInfo} {
allow read;
allow write: if request.auth.token.admin == true;
}
}
}