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

zed import ignores value of --schema-definition-prefix when referencing caveats #370

Open
zd9KgA opened this issue Apr 16, 2024 · 0 comments

Comments

@zd9KgA
Copy link

zd9KgA commented Apr 16, 2024

With file import.yaml as:

schema: |-2
  definition user {}

  caveat only_on_tuesday(day_of_week string) {
    day_of_week == 'tuesday'
  }

  definition document {
      relation reader: user | user with only_on_tuesday

      permission view = reader
  }

the following unexpected behavior can be observed:

$ zed  import --schema=True --relationships=True --schema-definition-prefix=authzed import.yaml
> INF importing schema
> ERR terminated with errors error="rpc error: code = FailedPrecondition desc = could not lookup caveat `only_on_tuesday` for relation `reader`: caveat `only_on_tuesday` not found"
$ zed version
> client: zed v0.17.1
> ...
> service: v1.30.0

This can be "fixed" by prefixing the reference of "only_on_tuesday" by the intended permission system prefix "authzed/".

The expected behavior is that the import works for the example as is, that is, that the permission system is automatically prefixed to caveat references as well.

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

1 participant