Using firestore with angularfire2 rc 2.
All is working very nicely in development with no effective security rules.
These are the no security rules - where the cli
The short answer is that {userId=**}
results in userId
being a path
and not a string
. This means that comparing it to request.auth.uid
(which is a string) will fail. Instead, you'll likely want something like:
service cloud.firestore {
match /databases/{database}/documents {
match /collectionA/{userId}/{allSubcollections=**} {
allow read, write: if request.auth.uid == userId;
}
}
}
This will guarantee that userId
is a string, and then match the appropriate subcollections (note that again, allSubcollections
will be a path
).