Nikos
Nikos

Reputation: 7552

Fireplace update allowed but set fails with "Simulated set denied"

I have these rules

{
    "rules": {
        "categories": { ".read": true },
        "conversations": {
            "$key": {

                "users": {
                    ".write": true
                   
                },
            }
        },

I tried to post to /conversations/44da/ this data:

{
  "users": "value"
}

which works fine with using update method enter image description here

but set fails

enter image description here

Upvotes: 1

Views: 75

Answers (1)

HeroesVII
HeroesVII

Reputation: 148

When you update, you save the data to the user node. This means searching for rules in the database will find "write true" on line 8.

But when you set a new value, you write in node $ key (44da) (because the user does not exist yet), or even in node "conversations" (in case node 44da does not exist either). The database searches for rules for the conversation of the $ key node or node, but no rules are set there.

Upvotes: 1

Related Questions