This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
62 lines (54 loc) · 1.53 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
rules_version = '2';
/*
Important notes:
- Write perms: write, create, update, delete
- Read perms: read, get, list
*/
service cloud.firestore {
match /databases/{database}/documents {
//NEVER DISABLE __VERSION ACCEESS
match /__VERSION/{document=**} {
allow read;
}
//NEVER DISABLE __VERSION ACCEESS
match /configs/mobile-app {
allow read;
}
match /devices/{document=**} {
allow read, write;
}
match /countdowns/{document=**} {
allow read;
}
match /events/{document=**} {
allow read;
}
match /sponsors/{document=**} {
allow read;
}
match /past-notifications/{document=**} {
allow get;
}
match /valid-attributes/{document=**} {
allow read;
}
match /users/{userId} {
allow read: if request.auth != null
allow write: if request.auth != null && request.auth.uid == userId
match /attributes/{attribute} {
allow read: if request.auth != null && request.auth.uid == userId
}
}
match /teams/{team_id} {
allow read: if request.auth != null
match /confidential/{document=**} {
allow read: if request.auth != null && request.auth.uid != null && request.auth.uid != "" &&
// Get the team entered in the user's firestore document
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.team
==
// Get the team they are trying to access
/databases/$(database)/documents/teams/$(team_id)
}
}
}
}