-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
31 lines (31 loc) · 980 Bytes
/
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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// limit data changing to us
function isSysAdmin() {
return request.auth.uid == "kleinsv" || request.auth.uid == "chanb" || request.auth.uid == "budakrc" || request.auth.uid == "yoder1";
}
match /Locations/{location} {
allow read;
allow write: if isSysAdmin();
}
match /Connections/{connection} {
allow read;
allow write: if isSysAdmin();
}
match /Constants/{document=**} {
allow read;
allow write: if isSysAdmin();
}
match /Users/{user} {
// from https://firebase.google.com/docs/firestore/security/rules-conditions?authuser=0
allow read, update, delete: if request.auth != null && request.auth.uid == user;
allow create: if request.auth != null;
}
// allow anyone to read anything (fix later)
// match /{document=**} {
// allow read;
// // allow write;
// }
}
}