Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- users {
- $uid {
- username: "username1",
- gender: "xyz"
- email: "xyz"
- }
- },
- usernames {
- "username1": $uid"
- }
- {
- "rules": {
- "users": {
- "$uid": {
- ".write": "auth !== null && auth.uid === $uid",
- ".read": "auth !== null && auth.uid === $uid",
- "username": {
- ".validate": "
- !root.child('usernames').child(newData.val()).exists() ||
- root.child('usernames').child(newData.val()).val() == $uid"
- }
- }
- },
- "usernames" : {
- ".write": "!data.exists() && auth!= null",
- ".validate": "newData.val() == auth.uid" <---- I can't get this too work
- }
- }
- }
- "usernames" : {
- "$username": {
- ".write": "!data.exists() && auth!= null",
- ".validate": "newData.val() == auth.uid"
- }
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement