SHARE
TWEET

Untitled

a guest Apr 21st, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.    "rules": {
  3.     "chats": {
  4.       "$chatID": {
  5.         "messages": {
  6.           ".read": "data.parent().child('members').child(auth.uid).exists()",
  7.           ".write": "data.parent().child('members').child(auth.uid).val() == 'owner' || data.parent().child('members').child(auth.uid).val()=='chatter'"
  8.         },
  9.         "members": {
  10.           ".read": "data.child(auth.uid).val() == 'owner'",
  11.           ".write": "data.child(auth.uid).val() == 'owner' ||(!data.exists()&&newData.child(auth.uid).val()=='owner')"
  12.         },
  13.         "pending": {
  14.           ".read": "data.parent().child('members').child(auth.uid).val() === 'owner'",
  15.           ".write": "data.parent().child('members').child(auth.uid).val() === 'owner'",
  16.           "$uid": {
  17.             ".write": "$uid === auth.uid && !data.exists() && !data.parent().parent().child('members').child($uid).exists()"
  18.           }
  19.         }
  20.       }
  21.     }
  22.   }
  23. }
RAW Paste Data
Top