-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfirestore.rules
More file actions
33 lines (27 loc) · 897 Bytes
/
firestore.rules
File metadata and controls
33 lines (27 loc) · 897 Bytes
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
service cloud.firestore {
match /databases/{database}/documents {
function authenticated() { return request.auth.uid != null }
function isAdmin() { return get(/databases/$(database)/documents/permissions/$(request.auth.uid)).data.isAdmin == true}
function isAdmin2() { return exists(/databases/$(database)/documents/permissions/$(request.auth.uid))}
match /permissions/{permUserId} {
allow read: if true;
allow write: if isAdmin();
}
match /meetups/{meetupId} {
allow read: if true;
allow write: if isAdmin();
}
match /members/{memberId} {
allow read: if isAdmin();
allow write: if isAdmin();
}
match /sponsors/{sponsorId} {
allow read: if true;
allow write: if isAdmin();
}
match /sponsorsPrivateData/{sponsorId} {
allow read: if isAdmin();
allow write: if isAdmin();
}
}
}