-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
28 lines (24 loc) · 1.15 KB
/
storage.rules
File metadata and controls
28 lines (24 loc) · 1.15 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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Original Uploads: Allow users to read/write files only within their own folder.
// Path: audiobooks/{userId}/{fileName}
match /audiobooks/{userId}/{allPaths=**} {
// Allow read/write (upload/download/delete) if the user is authenticated
// and the {userId} in the path matches their authentication UID.
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Generated Audio Files: Allow users to read/write files only within their own folder.
// Path: audiobooks_generated/{userId}/{fileName}
match /audiobooks_generated/{userId}/{allPaths=**} {
// Allow read/write (upload/download/delete) if the user is authenticated
// and the {userId} in the path matches their authentication UID.
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Other paths (if any): Add more specific rules or deny access by default.
// Deny access to all other paths by default unless explicitly allowed.
// match /{allPaths=**} {
// allow read, write: if false;
// }
}
}