Skip to content

Commit 251d1fd

Browse files
committed
Introduction to Firebase Security Rules
1 parent 8ee0dd4 commit 251d1fd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

database.rules.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"rules": {
3+
"flashcards": {
4+
"$deckId": {
5+
".read": "data.child('visibility').val() == 'public' || data.child('owner').val() == auth.uid",
6+
".write": true
7+
}
8+
},
9+
"homepage": {
10+
".read": true,
11+
".write": true
12+
},
13+
"users": {
14+
".read": true,
15+
".write": true
16+
}
17+
}
18+
}

firebase.json

+3
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"destination": "/index.html"
1414
}
1515
]
16+
},
17+
"database": {
18+
"rules": "database.rules.json"
1619
}
1720
}

0 commit comments

Comments
 (0)