-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
34 lines (29 loc) · 1.02 KB
/
Copy pathfirestore.rules
File metadata and controls
34 lines (29 loc) · 1.02 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// User records: users may read their own record; only Cloud Functions
// (Admin SDK, bypasses rules) write roles.
match /users/{userId} {
allow read: if request.auth != null
&& (request.auth.uid == userId || request.auth.token.role == 'CEO');
allow write: if false;
}
// Encrypted NIN/BVN ciphertext (§6.2) — server-only.
// Reads happen exclusively through the decryptIdentity callable.
match /identity/{aggregatorId} {
allow read, write: if false;
}
// Device secret hashes (§6.1) — server-only.
match /device_secrets/{deviceId} {
allow read, write: if false;
}
// Audit logs (§6.2) — CEO may read; only Cloud Functions write.
match /audit_logs/{logId} {
allow read: if request.auth != null && request.auth.token.role == 'CEO';
allow write: if false;
}
match /{document=**} {
allow read, write: if false;
}
}
}