forked from roshankumar0036singh/Uni-Event
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
35 lines (34 loc) · 1.44 KB
/
Copy pathstorage.rules
File metadata and controls
35 lines (34 loc) · 1.44 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
33
34
35
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /feedback/{userId}/{file=**} {
allow write: if request.auth != null
&& request.auth.uid == userId
&& request.resource.size < 5 * 1024 * 1024
&& request.resource.contentType.matches('image/(jpeg|png|webp)');
allow read: if request.auth != null
&& (request.auth.uid == userId
|| request.auth.token.admin == true);
}
match /users/{uid}/avatar{
allow read: if true;
allow write: if request.auth != null
&& request.auth.uid == uid
&& request.resource.size < 5*1024*1024
&& request.resource.contentType.matches('image/(jpeg|png|webp)');
}
match /events/{eventId}/{file=**}{
allow read: if true;
allow write: if request.auth != null
&& (request.auth.token.admin == true ||
(request.auth.token.club == true &&
firestore.exists(/databases/(default)/documents/events/$(eventId)) &&
request.auth.uid == firestore.get(/databases/(default)/documents/events/$(eventId)).data.ownerId))
&& request.resource.size < 5*1024*1024
&& request.resource.contentType.matches('image/(jpeg|png|webp)');
}
match /{allPaths=**} {
allow read, write: if false;
}
}
}