-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfirestore.rules
16 lines (15 loc) · 961 Bytes
/
firestore.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
match /mindmaps/{mindmap} {
allow create: if request.auth.uid != null;
allow delete: if request.auth.uid != null && request.auth.uid == resource.data.permissions.owner;
allow get: if request.auth.uid != null && request.auth.uid == resource.data.permissions.owner || resource.data.permissions.isPublic;
allow list: if request.auth.uid != null && (request.auth.uid == resource.data.permissions.owner || (request.auth.uid != resource.data.permissions.owner && resource.data.permissions.isPublic && request.auth.uid in resource.data.metadata.everUpdatedBy));
allow update: if request.auth.uid != null && request.auth.uid == resource.data.permissions.owner || (resource.data.permissions.isPublic && request.resource.data.permissions.canPublicEdit);
}
}
}
}