Created
September 11, 2018 13:16
-
-
Save jperasmus/73741d5d86ad146b56b61f552786c167 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": { | |
"flamelink": { | |
".read": "root.child('flamelink').child('users').child(auth.uid).child('enabled').val() === 'Yes'", | |
".write": "root.child('flamelink').child('users').child(auth.uid).child('enabled').val() === 'Yes'", | |
"environments": { | |
"$environment": { | |
"content": { | |
"$contentType": { | |
"$locale": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('update').val() === true))", | |
"$contentId": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('content').child($environment).child($contentType).child('update').val() === true))" | |
} | |
} | |
} | |
}, | |
"schemas": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('schemas').child($environment).child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('schemas').child($environment).child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('schemas').child($environment).child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('schemas').child($environment).child('update').val() === true))" | |
}, | |
"navigation": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('navigation').child($environment).child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('navigation').child($environment).child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('navigation').child($environment).child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('navigation').child($environment).child('update').val() === true))" | |
} | |
} | |
}, | |
"media": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('media').child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('media').child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('media').child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('media').child('update').val() === true))" | |
}, | |
"permissions": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('permissions').child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('permissions').child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('permissions').child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('permissions').child('update').val() === true))" | |
}, | |
"settings": { | |
"$section": { | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('settings').child($section).child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('settings').child($section).child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('settings').child($section).child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('settings').child($section).child('update').val() === true))" | |
} | |
}, | |
"users": { | |
".indexOn": ["email", "id"], | |
".read": "auth != null && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('users').child('view').val() === true", | |
".write": "auth !== null && ((!data.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('users').child('create').val() === true) || (!newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('users').child('delete').val() === true) || (data.exists() && newData.exists() && root.child('flamelink').child('permissions').child(root.child('flamelink').child('users').child(auth.uid).child('permissions').val() + '').child('users').child('update').val() === true))" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment