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] Support using auth() with a collection predicate expression #803

Closed
ymc9 opened this issue Nov 2, 2023 · 2 comments
Closed
Milestone

Comments

@ymc9
Copy link
Member

ymc9 commented Nov 2, 2023

Here's a scenario:

model User {
    ...
    roles Role[]
}

model Role {
    ...
    permission string
}

The desired policy is:

@@allow('all', auth().roles?[permission == 'ADMIN'])
@ymc9
Copy link
Member Author

ymc9 commented Nov 2, 2023

@ymc9 ymc9 added this to the v1.3.0 milestone Nov 2, 2023
@ymc9
Copy link
Member Author

ymc9 commented Nov 3, 2023

Before this is implemented, you can use a workaround as shown in this repo: https://github.com/ymc9/zenstack-auth-relation

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

No branches or pull requests

1 participant