November 2017
Beginner to intermediate
288 pages
7h 33m
English
Now, let's suppose we have some user-based files that we don't want anyone to read and even write, that is, add a new file to another user personal space, so let's see how we can achieve that:
match /secured/personal/{userId}/images/{imageId} { allow read: if request.auth.uid == userId; } match /secured/personal/{userId}/books/{bookId} { allow read: if request.auth.uid == userId; } match /secured/personal/{userId}/images/{imageId} { allow write: if request.auth.uid == userId && request.resource.size < 15 * 1024 * 1024 && request.resource.contentType.matches('image/.*'); } match /secured/personal/{userId}/books/{bookId} { allow write: if request.auth.uid == userId && request.resource.size < 100 * 1024 * 1024 && request.resource.contentType. ...
Read now
Unlock full access