Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add support for bitwise operators in access policies #2023

Open
sanny-io opened this issue Mar 1, 2025 · 1 comment
Open

Comments

@sanny-io
Copy link

sanny-io commented Mar 1, 2025

Is your feature request related to a problem? Please describe.
I'm using bitflags for a permission system, but I can't tie that in with Zenstack's access policies without bitwise operators.

Describe the solution you'd like
The ability to use bitwise operators like &, |, ~, etc.

Describe alternatives you've considered
I've tried granting permissions as individual rows, but it's much more unwieldy compared to having all of the permissions encoded into a single column.

Additional context
Ideally, it would work with any numeric column type. Bitflags in particular can get quite large. I'm using BigInt

Also, I want to express my gratitude for the work you guys do. I just sponsored the project, but it wouldn't let me include a message to say thanks :<

Zenstack is awesome, and you are amazing maintainers!

@ymc9
Copy link
Member

ymc9 commented Mar 1, 2025

Hi @sanny-io , really appreciate your sponsorship. It means a lot to us! We're glad you've found ZenStack helpful.

As to this feature request, I agree it's a very nice ability to have. However, the hurdle is ZenStack's access policy engine works by translating the policy expressions into Prisma query filters (so the rules can be efficiently evaluated on the database side). Unfortunately Prisma doesn't support bitwise filter yet. There's a FR but there hasn't been any progress yet.

We're in the process of evaluating how ZenStack's next major version can address more flexibility issues like this one you proposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants