Skip to content
New issue

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

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

Already on GitHub? # to your account

[Feature Request] enable template strings/ string interpolation in policies #1985

Open
CollinKempkes opened this issue Feb 12, 2025 · 0 comments

Comments

@CollinKempkes
Copy link

Is your feature request related to a problem? Please describe.
It would be really neat if we could use string interpolation in policies as we have some kind of problem for restriction checks.
For example:

@@allow('all', 
    auth().restrictions?[
      scopes?[policy_name == "${currentModel()}:${currentOperation()}"
    ]]
  )

Sure it would be possible to use something like startsWith and endsWith, but this is also not quite the same as we this can lead to different problems down the road.

Describe alternatives you've considered
An alternative for us right now is only refactoring the attributes so we don't have policy_name = "user:read" rather than resource = 'user', action = 'read'. But for this we have to do some kind of refactor and don't know if we would encounter this problem again in the future. Would just be nice to have the option to do it.

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

No branches or pull requests

1 participant