Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (22 sloc) 720 Bytes
service cloud.firestore {
function isSignedIn() {
return request.auth != null;
}
function isOwnedByUser() {
return resource.data.uid == request.auth.uid;
}
function isCreatingWithUserId() {
return request.auth.uid == request.resource.data.uid;
}
match /databases/{database}/documents {
match /captions/{caption} {
allow update: if isOwnedByUser() && isCreatingWithUserId();
allow delete: if isOwnedByUser();
allow create: if isCreatingWithUserId();
allow read: if isOwnedByUser();
match /entries/{entry} {
allow read, write: if get(/databases/$(database)/documents/captions/$(caption)).data.uid == request.auth.uid;
}
}
}
}
You can’t perform that action at this time.