-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase_storage.rules
More file actions
32 lines (27 loc) · 1.16 KB
/
firebase_storage.rules
File metadata and controls
32 lines (27 loc) · 1.16 KB
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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Profile pictures - allow authenticated users to read and write
match /profile-pics/{allPaths=**} {
// Allow read access to all authenticated users
allow read: if request.auth != null;
// Allow write access to authenticated users with restrictions
allow write: if request.auth != null
&& request.resource.size < 5 * 1024 * 1024 // 5MB limit
&& request.resource.contentType.matches('image/(jpeg|png|jpg)');
}
// Children profile pictures - allow authenticated users to read and write
match /child-profile-pics/{allPaths=**} {
// Allow read access to all authenticated users
allow read: if request.auth != null;
// Allow write access to authenticated users with restrictions
allow write: if request.auth != null
&& request.resource.size < 5 * 1024 * 1024 // 5MB limit
&& request.resource.contentType.matches('image/(jpeg|png|jpg)');
}
// Deny all other access
match /{allPaths=**} {
allow read, write: if false;
}
}
}