-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.rules
35 lines (25 loc) · 950 Bytes
/
storage.rules
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
34
35
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /recipeImages/default/{allPaths=**} {
allow read: if true;
allow write: if false;
}
match /recipeImages/{userId}/{allPaths=**} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == userId;
}
match /thumbnails/default/{allPaths=**} {
allow read: if true;
allow write: if false;
}
match /thumbnails/{userId}/{allPaths=**} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == userId;
}
}
}
// Allow all users (authenticated or not) to read the default images
// No one is allowed to write (upload) to the default images path to maintain them as read-only
// Allow authenticated users to read uploded by usres thumbnails and recipeImages
// Allow authenticated user to write their own thumbnail and recipeImages