Skip to content

Commit

Permalink
simplified firebase rules
Browse files Browse the repository at this point in the history
  • Loading branch information
menduz committed Aug 22, 2020
1 parent 66f01a0 commit 45c5750
Show file tree
Hide file tree
Showing 2 changed files with 78,255 additions and 1,054 deletions.
79,268 changes: 78,254 additions & 1,014 deletions docs/index.js

Large diffs are not rendered by default.

41 changes: 1 addition & 40 deletions firebase-rules.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
{
"rules": {
"users": {
"anonymous": {
".read": false,
".write": false,
"notebooks": {
"$secretid": {
"meta": {
".read": true,
"uid": {
".read": true,
".write": "!data.exists()"
},
"title": {
".read": true,
// TODO: make sure editors are the only allowed to edit title
".write": true
}
},
"history": {
".read": true,
"$revision": {
/* Prevent overwriting existing revisions. */
".write": "data.val() === null"
}
},
"checkpoint": {
".read": true,
/* Ensure author of checkpoint is the same as the author of the revision they're checkpointing. */
".write": "root.child($secretid).child('history').child(newData.child('id').val()).child('a').val() === newData.child('a').val()",
".validate": "newData.hasChildren(['a', 'o', 'id'])"
},
"users": {
".read": true,
"$user": {
".write": true
}
}
}
}
},
"$userid": {
".read": true,
"profile": {
Expand All @@ -49,7 +10,7 @@
"notebooks": {
".read": "$userid == auth.uid",
"$secretid": {
".write": "$userid == auth.uid",
".write": "$userid == auth.uid || ($userid == 'anonymous' && auth.uid == null)",
"meta": {
".read": true,
"uid": {
Expand Down

0 comments on commit 45c5750

Please sign in to comment.