-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
31 lines (25 loc) · 765 Bytes
/
Copy pathfirestore.rules
File metadata and controls
31 lines (25 loc) · 765 Bytes
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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function signedIn() {
return request.auth != null;
}
function ownsExisting() {
return signedIn() && resource.data.userId == request.auth.uid;
}
function ownsIncoming() {
return signedIn() && request.resource.data.userId == request.auth.uid;
}
match /reasoningSessions/{sessionId} {
allow create: if ownsIncoming();
allow read, update, delete: if ownsExisting();
}
match /evaluationRuns/{runId} {
allow create: if ownsIncoming();
allow read, update, delete: if ownsExisting();
}
match /users/{userId} {
allow read, write: if signedIn() && request.auth.uid == userId;
}
}
}