-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
72 lines (70 loc) · 2.69 KB
/
firestore.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /feedItems/{feedItem} {
allow read: if true;
allow create: if request.auth.uid == request.resource.data.user.id;
allow delete, update: if request.auth.uid == resource.data.user.id;
}
match /folderItems/{folderItem} {
allow read: if resource.data.userId == request.auth.uid;
allow create: if request.auth.uid == request.resource.data.userId;
allow delete, update: if request.auth.uid == resource.data.userId;
}
match /followItems/{followItem} {
allow read: if request.auth.uid != null;
allow create: if request.auth.uid == request.resource.data.followingUser.id;
allow delete, update: if request.auth.uid == resource.data.followingUser.id;
}
match /posts/{post=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth.uid == request.resource.data.user.id;
allow delete: if request.auth.uid == resource.data.user.id;
}
match /productItems/{productItem=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth != null;
allow delete: if request.auth.uid == resource.data.user.id;
}
match /products/{product=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth != null;
allow delete: if true
}
match /suppliers/{supplier=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth != null;
allow delete: if request.auth.uid == resource.data.user.id;
}
match /invitedDesigners/{designer=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth.uid == request.resource.data.user.id;
allow delete: if request.auth.uid == resource.data.user.id;
}
match /supplierInvites/{designer=**} {
allow read: if true;
allow update: if request.auth != null;
allow create: if request.auth.uid == request.resource.data.user.id;
allow delete: if request.auth.uid == resource.data.user.id;
}
match /users/{user} {
allow read: if true;
allow write: if request.auth.uid == user;
match /folders/{folder} {
allow read, write: if request.auth.uid == user;
}
match /notifications/{notification} {
allow read: if request.auth.uid == user;
allow write: if request.auth.uid == user || request.auth.uid == request.resource.data.user.id;
}
}
match /registrations/{registration} {
allow read, write: if request.auth.uid != null;
}
}
}