Skip to content

Commit c74820a

Browse files
Sung KimSung Kim
Sung Kim
authored and
Sung Kim
committed
Added firebse rule
1 parent 5635193 commit c74820a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

firebase.rule.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"rules": {
3+
"$roomname": {
4+
"questions": {
5+
".read": true,
6+
".write": true,
7+
8+
// Must have echo, head, desc
9+
// ".validate": "newData.hasChildren(['echo', 'head', 'desc', 'timestamp'])",
10+
11+
// a widget can have a title or color attribute
12+
"echo": { ".validate": "newData.isNumber()" },
13+
"head": { ".validate": "newData.isString()"},
14+
"desc": { ".validate": true },
15+
"timestamp": { ".validate": "newData.val() <= now" }
16+
17+
// but no other child paths are allowed
18+
// in this case, $other means any key excluding "title" and "color"
19+
//"$other": { ".validate": false }
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)