We are working on rules for our app and need quick hand to decipher the rules output (it's our first go with the simulator)
we have a single firebase user, email + password authentication
Authenticate as a user
Custom Auth: { id: 10023, provider: 'password', uid: 'simplelogin:10023' }
data is
-users
-simplelogin:10023
email: name@someurl.com
rules are
"rules": {
".read": false,
".write": false,
"users": {
"$user_id" : {
".read": "auth != null && $user_id === auth.uid",
".write": "auth != null && $user_id === auth.uid"
}
}
output is
Attempt to read /users/simplelogin:10023/email with auth=Success({"id":10023,"provider":"password","uid":"simplelogin:10023"})
/: "false"
=> false
/users
/users/simplelogin:10023: "auth != null && $user_id === auth.uid"
=> true
Read was allowed.
On first glance it appears the simulator is trying to check the rules on the node twice; once with the auth=Success rule, which is false, and once with the auth != null rule, which results in true. What's actually going on here?
as a test, we removed the
".read": false,
".write": false,
and the output was changed in that the results from the first auth=Success
was now just a / which didn't really tell us anything
As a followup, is there any documentation on using the simulator or understanding the output? Googled it and checked the site to no avail - perhaps we just overlooked it.