forked from Uniswap/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
42 lines (38 loc) · 2.95 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write, create, update, delete: if request.auth != null && request.auth.token.admin == true;
}
match /address_data/address_uid_mapping/{address}/firebase {
allow write: if request.auth != null && request.resource.data.keys().hasOnly([request.auth.uid]) && request.resource.data[request.auth.uid] == true;
allow update, delete: if request.auth != null && request.resource.data.diff(resource.data).affectedKeys().hasOnly([request.auth.uid]);
}
match /address_data/address_push_token_mapping/{address}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
match /address_data/metadata/{address}/onesignal_uids/{uid}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
match /dev_address_data/address_uid_mapping/{address}/firebase {
allow write: if request.auth != null && request.resource.data.keys().hasOnly([request.auth.uid]) && request.resource.data[request.auth.uid] == true;
allow update, delete: if request.auth != null && request.resource.data.diff(resource.data).affectedKeys().hasOnly([request.auth.uid]);
}
match /dev_address_data/address_push_token_mapping/{address}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/dev_address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
match /dev_address_data/metadata/{address}/onesignal_uids/{uid}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/dev_address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
match /beta_address_data/address_uid_mapping/{address}/firebase {
allow write: if request.auth != null && request.resource.data.keys().hasOnly([request.auth.uid]) && request.resource.data[request.auth.uid] == true;
allow update, delete: if request.auth != null && request.resource.data.diff(resource.data).affectedKeys().hasOnly([request.auth.uid]);
}
match /beta_address_data/address_push_token_mapping/{address}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/beta_address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
match /beta_address_data/metadata/{address}/onesignal_uids/{uid}/{document=**} {
allow write, update, delete: if request.auth != null && get(/databases/$(database)/documents/beta_address_data/address_uid_mapping/$(address)/firebase).data[request.auth.uid] == true;
}
}
}