-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
45 lines (34 loc) · 946 Bytes
/
notes.txt
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
36
37
38
39
40
41
42
43
44
45
// FIRESTORE RULES
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Listings
match /listings/{listing} {
allow read;
allow create: if request.auth != null && request.resource.data.imgUrls.size() < 7;
allow delete: if resource.data.userRef == request.auth.uid;
allow update: if resource.data.userRef == request.auth.uid;
}
// Users
match /users/{user} {
allow read;
allow create;
allow update: if request.auth.uid == user
}
}
}
=========================================================================
// STORAGE RULES
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read;
allow write: if
request.auth != null &&
request.resource.size < 2 * 1024 * 1024 && //2MB
request.resource.contentType.matches('image/.*')
}
}
}
================