forked from FirebaseExtended/firepad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate-auth.json
More file actions
25 lines (25 loc) · 927 Bytes
/
validate-auth.json
File metadata and controls
25 lines (25 loc) · 927 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
/* Example assumes your Firepad is at the root of your Firebase Database. */
{
"rules": {
"history": {
".read": "auth != null",
"$revision": {
/* Allow writing a revision as long as it doesn't already exist and you write your auth.uid as the 'a' field. */
".write": "data.val() === null && newData.child('a').val() === auth.uid"
}
},
"users": {
".read": "auth != null",
"$userid": {
/* You may freely modify your own user info. */
".write": "$userid === auth.uid"
}
},
"checkpoint": {
".read": "auth != null",
/* You may write a checkpoint as long as you're writing your auth.uid as the 'a' field and you
also wrote the revision that you're checkpointing. */
".write": "newData.child('a').val() === auth.uid && root.child('history').child(newData.child('id').val()).child('a').val() === auth.uid"
}
}
}