-
Notifications
You must be signed in to change notification settings - Fork 1
/
firestore.rules
59 lines (48 loc) · 2.39 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userID}/status/fields {
allow read: if request.auth.uid == userID || exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow update: if request.auth != null && exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /users/{userID} {
allow read: if request.auth.uid == userID || exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /users/--stats-- {
allow read: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow write: if request.auth != null;
}
match /users/{userID}/application/fields {
allow read: if request.auth.uid == userID || exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow write: if request.auth.uid == userID && get(/databases/$(database)/documents/hackathon/info).data.appOpen == true
}
match /applications/--stats-- {
allow read: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /hackathon/info {
allow read: if request.auth != null;
allow update: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /confirmation/{userID} {
allow read: if request.auth.uid == userID || exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow write: if request.auth.uid == userID && get(/databases/$(database)/documents/hackathon/info).data.confOpen == true
}
match /confirmation/--stats-- {
allow read: if exists(/admins/$(request.auth.uid));
allow write: if request.auth != null;
}
match /admins/{userID} {
allow read: if request.auth.uid == userID && exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /users/{userID} {
allow read, write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid))
}
match /teams/{teamID} {
allow read: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.team_ID == teamID || exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /calendar/{day}/events/{event_ID} {
allow read: if request.auth != null;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
}
}