-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.rules
23 lines (21 loc) · 1021 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
rules_version = '2';
service firebase.storage {
match /b/slack-6f481.appspot.com/o {
match /avatars {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == userId && request.resource.contentType.matches('image/.*') && request.resource.size < 1 * 1024 * 1024;
}
}
match /chat {
match /public/{imagePath=**} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.resource.contentType.matches('image/.*') && request.resource.size < 1 * 1024 * 1024;
}
match /private/{userId1}/{userId2}/{imagePath=**} {
allow read: if request.auth != null && (request.auth.uid == userId1 || request.auth.uid == userId2);
allow write: if request.auth != null && (request.auth.uid == userId1 || request.auth.uid == userId2) && request.resource.contentType.matches('image/.*') && request.resource.size < 1 * 1024 * 1024;
}
}
}
}