This repository was archived by the owner on Mar 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 4848 // so instead we just prevent a user to add to himself a radio that already
4949 // has tracks in -> so no radio hijack
5050 ".validate" : " root.child('channels').child($channelID).exists() && !root.child('users').child(auth.uid).child('channels').child($channelID).exists() && !root.child('channels').child($channelID).child('tracks').exists()"
51- }
51+ }
5252 }/*,
5353 "$other" : {
5454 ".validate" : false
6666 // write: only logged-in-user without a user settings can create a new one to himself
6767 ".read" : " auth != null && (data.child('user').val() === auth.uid)" ,
6868 ".write" : " auth != null && ((data.child('user').val() === auth.uid) || (root.child('users').child(auth.uid).hasChild('settings') === false))" ,
69- ".validate" : " newData.hasChild('user')" ,
69+ ".validate" : " newData.hasChild('user')" ,
7070 "user" : {
7171 ".validate" : " newData.val() === auth.uid"
7272 },
7373 "isRemoteActive" : {
7474 ".validate" : " newData.isBoolean()"
7575 },
76- "playedChannels" : {
77- "$channel" : {
76+ "playedChannels" : {
77+ "$channel" : {
7878 ".validate" : " newData.isBoolean() && root.child('channels').child($channel).exists()"
79- }
80- },
79+ }
80+ },
8181 "$other" : {
8282 ".validate" : false
8383 }
105105 },
106106 "created" : {
107107 // Ensure type::number and that you can not update it
108- ".validate" : " data.exists() && data.val() === newData.val() || newData.val() > now - 1000"
108+ // OR allow a timestamp within the last second
109+ ".validate" : " data.exists() && data.val() === newData.val() || (newData.val() >= now -1000 && newData.val() <= now)"
109110 },
110111 "updated" : {
111112 // Ensure type::number and that you can not update it
You can’t perform that action at this time.
0 commit comments