-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
19 lines (15 loc) · 971 Bytes
/
firestore.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow create: if (userId == request.auth.uid) && (request.resource.data.size() == 2) && ('email' in request.resource.data) && ('firstName' in request.resource.data) && (request.resource.data.email == request.auth.token.email)
match /calendars/{calendar} {
allow create: if (userId == request.auth.uid) && (request.resource.data.size() == 2) && ('name' in request.resource.data) && ('color' in request.resource.data) && (request.resource.data['color'].matches('#[a-fA-F0-9]{6}$'))
allow list: if (userId == request.auth.uid)
}
match /todolists/{list} {
allow create: if (userId == request.auth.uid) && (request.resource.data.size() == 2) && ('name' in request.resource.data) && ('color' in request.resource.data) && (request.resource.data['color'].matches('#[a-fA-F0-9]{6}$'))
}
}
}
}