Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. users {
  2. $uid {
  3. username: "username1",
  4. gender: "xyz"
  5. email: "xyz"
  6. }
  7. },
  8. usernames {
  9. "username1": $uid"
  10. }
  11.  
  12. {
  13. "rules": {
  14. "users": {
  15. "$uid": {
  16. ".write": "auth !== null && auth.uid === $uid",
  17. ".read": "auth !== null && auth.uid === $uid",
  18. "username": {
  19. ".validate": "
  20. !root.child('usernames').child(newData.val()).exists() ||
  21. root.child('usernames').child(newData.val()).val() == $uid"
  22. }
  23. }
  24. },
  25. "usernames" : {
  26. ".write": "!data.exists() && auth!= null",
  27. ".validate": "newData.val() == auth.uid" <---- I can't get this too work
  28. }
  29. }
  30. }
  31.  
  32. "usernames" : {
  33. "$username": {
  34. ".write": "!data.exists() && auth!= null",
  35. ".validate": "newData.val() == auth.uid"
  36. }
  37. },
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement