Skip to content

"now()" function in Access Policies #478

@rickserraglia

Description

@rickserraglia

Before any requests, I would just like to thank you for the work you've done, we are in love with your solutions, it's been amazing to work with ZenStack on our stack.

This week we were wondering about the possibility of including date validation in access policies, which was something that Supabase offered us, and we didn't find it in ZenStack (but seriously, we managed to survive without it, your solution is by far the best for us even without it).

It's a function that would compare the timestamp of some date column with the current time. And that it was possible to create comparisons (<, >, <=, >=, =, ==).

How it works in Supabase RLS:
((now() >= starts_at) AND (now() <= ends_at))

How could be in ZenStack Access Policy:
@@allow('read', startsAt <= now() && endsAt >= now())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions