firebase - list only items you have access to -
background
i have set of items user may append to, may read/write items own.
this simplified version of i'm working on. can't make $uid
part of path because these items shared specific other users.
"session": { "$other": { ".validate": "(!data.child('owner').exists() && newdata.child('owner').val() == auth.uid) || newdata.child('owner').val() == data.child('owner').val()", ".read": "data.child('owner').val() == auth.uid", ".write": "newdata.child('owner').val() == auth.uid" } }
given above rules user may push({ owner: my_uid })
list. have verified user may read , write newly created record.
question
how can user find of records has access to?
"session": { "index": { "$uid": { ".read": "$uid == auth.uid", "$sessionid": { ".write": true } } }, "$other": { ".validate": "(!data.child('owner').exists() && newdata.child('owner').val() == auth.uid) || newdata.child('owner').val() == data.child('owner').val()", ".read": "data.child('owner').val() == auth.uid", ".write": "newdata.child('owner').val() == auth.uid" } }
with approach every time create session/<id>/
create entry under session/index/<uid>/<id>
. because user can write address, can read should able share user writing index.
Comments
Post a Comment