angularfire - Firebase Security Rules Nesting -


i creating reddit-type app. have array of stories, , each story has title, description, , votecount. want have separate .write rules votecount, structured rules -

"stories": {   "$story_id": {      "title": { ".write": "auth !== null" },     "description" { ".write": "auth !== null" },     "votecount": { ".write": "newdata.val() === data.val() + 1" },    } } 

this works existing stories.however, no longer allows me add new story, unless add .write rule directly $story_id node. , of course stops me having special .write rule votecount node.

any ideas on why happens?

so users have .write access on higher level, can write data follow specific rules?

you'll want put in .validation rule, instead of .write rule.

a simple way remember .write rules determine who can write data, while .validate rules determine what data can written.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -