-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
29 lines (27 loc) · 1.09 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
service cloud.firestore {
match /databases/{database}/documents {
match /events/{event} {
allow read: if request.auth.uid != null;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /event_series/{event} {
allow read: if request.auth.uid != null;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /events/{event}/people/{userId} {
allow write: if request.auth.uid == userId;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow read: if request.auth.uid != null;
}
match /admins/{admin} {
allow read: if request.auth.uid != null;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
match /users/{userId} {
allow read: if request.auth.uid != null;
allow update, delete: if request.auth.uid == userId;
allow write: if exists(/databases/$(database)/documents/admins/$(request.auth.uid));
allow create: if request.auth.uid != null;
}
}
}