Last active
January 9, 2016 22:19
-
-
Save rockwotj/730502a30f9003c19a9f to your computer and use it in GitHub Desktop.
Firebase bolt rules for the Password Keeper App
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
path /users/$uid { | |
read() = isCurrentUser($uid); | |
write() = isCurrentUser($uid); | |
} | |
path /users/$uid/$password is Password; | |
type Password { | |
service: String, | |
password: String, | |
username: String | Null | |
} | |
isCurrentUser(userid) = auth != null && auth.uid == userid; |
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": { | |
"users": { | |
"$uid": { | |
".read": "auth != null && auth.uid == $uid", | |
".write": "auth != null && auth.uid == $uid", | |
"$password": { | |
".validate": "newData.hasChildren(['service', 'password'])", | |
"service": { | |
".validate": "newData.isString()" | |
}, | |
"password": { | |
".validate": "newData.isString()" | |
}, | |
"username": { | |
".validate": "newData.isString() || newData.val() == null" | |
}, | |
"$other": { | |
".validate": "false" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment