-
Notifications
You must be signed in to change notification settings - Fork 6
/
storage.rules
34 lines (30 loc) · 1.1 KB
/
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
rules_version = '2';
service firebase.storage {
match /b/slack-chat-app-clone.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;
}
}
}
}