-
Notifications
You must be signed in to change notification settings - Fork 12
/
firestore.rules
87 lines (84 loc) · 2.87 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /abyssal-expedition/{userId} {
allow read;
allow write: if request.auth.uid == userId;
}
match /heroes/{userId} {
allow read;
allow write: if request.auth.uid == userId;
}
match /priority-list/{document=**} {
allow read;
allow create: if request.auth != null;
allow update: if request.auth.uid == resource.data.ownerId;
allow delete: if request.auth.uid == resource.data.ownerId;
}
match /tree-list/{document=**} {
allow read;
allow create: if request.auth != null;
allow update: if request.auth.uid == resource.data.ownerId;
allow delete: if request.auth.uid == resource.data.ownerId;
}
match /pet-list/{document=**} {
allow read;
allow create: if request.auth != null;
allow update: if request.auth.uid == resource.data.ownerId;
allow delete: if request.auth.uid == resource.data.ownerId;
}
match /guild/{document=**} {
allow read;
allow create: if request.auth != null;
allow update: if request.auth.uid == resource.data.ownerId;
allow delete: if request.auth.uid == resource.data.ownerId;
match /{guildId} {
allow update: if (
request.auth != null &&
request.resource.data.diff(resource.data).affectedKeys().hasOnly(['applications'])
) ||
request.auth.uid == resource.data.ownerId ||
request.auth.uid in resource.data.deputies || (
request.auth.uid in resource.data.members &&
!(request.auth.uid in request.resource.data.members) &&
resource.data.members.size() == request.resource.data.members.size() + 1
);
}
}
match /profile/{userId} {
allow write: if request.auth.uid == userId;
allow read: if request.auth != null;
}
// Legacy API
match /campaign/{userId} {
allow write: if request.auth.uid == userId;
allow read: if request.auth.uid == userId;
}
match /fast-reward/{userId} {
allow write: if request.auth.uid == userId;
allow read: if request.auth.uid == userId;
}
match /hero-list/{userId} {
allow write: if request.auth.uid == userId;
allow create: if request.auth != null
allow read: if true;
}
match /abex/{userId} {
allow write: if request.auth.uid == userId;
allow create: if request.auth != null;
allow read: if request.auth.uid == userId;
}
match /user/{userId} {
allow write: if request.auth.uid == userId;
allow read: if true;
match /favorite/{favoriteType} {
allow write: if request.auth.uid == userId;
allow read: if request.auth.uid == userId;
}
match /priority-list/{listId} {
allow write: if request.auth.uid == userId;
allow read: if true;
}
}
}
}