-
Notifications
You must be signed in to change notification settings - Fork 1
/
firestore.rules
30 lines (28 loc) · 1.26 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
service cloud.firestore {
match /databases/{database}/documents {
match /projects/{projectId} {
allow read: if true;
allow create: if request.auth.uid != null
&& request.resource.data.ownerId == request.auth.uid
&& request.resource.data.createdAt is timestamp
&& request.resource.data.title is string
&& request.resource.data.description is string
&& request.resource.data.projectType is string
&& request.resource.data.country is string
&& request.resource.data.organizationName is string
&& request.resource.data.organizationType is string
&& request.resource.data.organizationLogo is string
&& request.resource.data.organizationDescription is string
&& request.resource.data.email is string
&& request.resource.data.organizationUrl is string
&& request.resource.data.deleted == null;
allow update: if get(/databases/$(database)/documents/projects/$(projectId)).data.ownerId == request.auth.uid;
match /volunteers/{userId} {
allow read: if request.auth.uid == userId;
allow create: if request.auth.uid == userId
&& request.resource.data.email is string
&& request.resource.data.message is string;
}
}
}
}