Allow read in FireStore rules based on timestamp value in document

前端 未结 5 1157
再見小時候
再見小時候 2020-12-11 07:11

I want to create a FireStore rule that grantes read privilages to documents after the current date has surpassed a timestamp value in the document.

This is for a bl

5条回答
  •  心在旅途
    2020-12-11 07:54

    firebaser here

    I tried the same thing a while ago, and found out it isn't currently possible.

    It is possible to allow/deny read to a specific document based on a property of that document.

    It is possible to allow a query that filters documents based on a property in that document, but currently that is only possible based on request.auth.

    This means that unfortunately your filter currently can't be implemented with security rules. I recommend you file a feature request to chime in.

    Update (2018-04-24): this might now be possible with request.time, but I haven't had a chance to test yet. Have a look here.

提交回复
热议问题