Git Product home page Git Product logo

Comments (3)

ginovva320 avatar ginovva320 commented on August 26, 2024

The rules cascading in that manner is intended. I believe to unlock the $parentId for writes, you'd need to use a $wilderchild. #46 is related.

from blaze_compiler.

tomlarkworthy avatar tomlarkworthy commented on August 26, 2024

Wilderchild will fix one issue but there is another bug I noticed last week
you are hitting. I will fix that today.

The rules cascading in that manner is intended. I believe to unlock the
$parentId for writes, you'd need to use a $wilderchild
https://github.com/firebase/blaze_compiler#wilderchild. #46
#46 is related.


Reply to this email directly or view it on GitHub
#56 (comment)
.

from blaze_compiler.

tomlarkworthy avatar tomlarkworthy commented on August 26, 2024

OK the bug I thought existed didn't. So

  1. you need a wilderchild's on $childId to do nesting, as ginovva320 said, so ~$childId
  2. wilderchilds are not properties, they are their own special commands so do not appear in the properties field. I have added some special error messages for detecting that case, as you are not the first to hit that unexpected behavior. (FYI it's to do with the JSONSchema spec)

Putting it all together I think this is what you want:-

schema:
  type: object
  additionalProperties: false
  properties:
    test:
      type: object
      $parentId:
        type: object
        ~$childId:
          type: object
          properties:
            timestamp: {type: number}

access:
  - location: /test/$parentId
    read:     auth.uid != null
    write:    auth.uid != null && prev.exists() == false

  - location: /test/$parentId/$childId
    write:    auth.uid != null && (prev.timestamp.exists() == false || next.timestamp >= prev.timestamp)

the better error message is in version 0.0.34

from blaze_compiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.