Last active
June 27, 2021 21:03
-
-
Save antoniorrm/708cdee7b432a2aadd9f573457a07516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"rooms": { | |
".read": false, | |
".write": "auth != null", | |
"$roomId": { | |
".read": true, | |
".write": "auth != null && (!data.exists() || data.child('authorId').val() == auth.id)", | |
"questions": { | |
".read": true, | |
".write": "auth != null && (!data.exists() || data.parent().child('authorId').val() == auth.id)", | |
"likes": { | |
".read": true, | |
".write": "auth != null && (!data.exists() || data.child('authorId').val() == auth.id)", | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"rooms": { | |
".read": false, | |
".write": false, | |
"$roomId": { | |
".read": "!root.child('/rooms/' + $roomId + '/endedAt').exists() || data.child('authorId').val() == auth.uid ", | |
".write": "auth != null && (!data.exists() || data.child('authorId').val() == auth.uid)", | |
"questions": { | |
".read": "!root.child('/rooms/' + $roomId + '/endedAt').exists()", | |
".write": false, | |
"$questionId":{ | |
".read": true, | |
".write": "auth != null && !root.child('/rooms/' + $roomId + '/endedAt').exists() && (!data.exists() || data.child('author/id').val() == auth.uid)", | |
"likes": { | |
".read": true, | |
".write": "auth != null", | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment