Firebase security rules based on userId attribute -
please see data structure
"errands" : { "-k0dgrao6vsqkhrwiajq" : { "name" : "milk", "permissions" : [ { "userid" : "ca8d19cb-f1d7-4bfd-9471-fb88c469b6ca" }, { "userid" : "ef4bacad-d713-47ac-853e-b3ec3e4bf684" } ], "store" : "coscto" }, "-k0dhstsyrfm3uzjptnn" : { "name" : "milk", "permissions" : [ { "userid" : "ca8d19cb-f1d7-4bfd-9471-fb88c469b6ca" }, { "userid" : "ef4bacad-d713-47ac-853e-b3ec3e4bf684" } ], "store" : "coscto" } }
i trying provide access based on userid attribute. says access denied.
".read": "root.child('errands').child('permissions').child('userid').val() === auth.uid ",
Comments
Post a Comment