forked from momander/wheel-spinner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
41 lines (41 loc) · 1.2 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
33
34
35
36
37
38
39
40
41
rules_version = "2";
service cloud.firestore {
match /databases/{database}/documents {
function isAdminUser() {
return exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /accounts/{email} {
allow read, write: if request.auth.token.email == email;
}
match /accounts/{email}/{document=**} {
allow read, write: if request.auth.token.email == email;
}
match /accounts/{uid} {
allow read, write: if request.auth.uid == uid;
}
match /accounts/{uid}/{document=**} {
allow read, write: if request.auth.uid == uid;
}
match /admins/{uid} {
allow read, write: if isAdminUser();
}
match /admins/{uid}/{document=**} {
allow read, write: if isAdminUser();
}
match /settings/{document=**} {
allow read, write: if isAdminUser()
}
match /carousels/{document=**} {
allow read, write: if isAdminUser()
}
match /shared-wheels/{document=**} {
allow read, write: if isAdminUser()
}
match /shared-wheels-review-queue/{document=**} {
allow read, write: if isAdminUser()
}
match /shared-wheels-rejected/{document=**} {
allow read, write: if isAdminUser()
}
}
}