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

[Cedar Doc Issue] Add examples for passing actions as entities in the input hierarchy #80

Open
JoshuaWilkes opened this issue Jan 29, 2024 · 1 comment

Comments

@JoshuaWilkes
Copy link

JoshuaWilkes commented Jan 29, 2024

What were you trying to do?
I have tried to use this example for a cedar policy https://docs.cedarpolicy.com/policies/syntax-policy.html#term-parc-action

//matches any action in the hierarchy of the admin entity of type PhotoFlashRole
action in PhotoFlashRole::"admin"

When you write a policy like this you get an error like below:

expected an entity uid with the type `Action` but got `PhotoFlashRole::"admin"`. Action entities must have type `Action`

What is wrong and why?
I can find no other reference to being able to define actions as children of Entities so I believe that this is a mistake in the docs.

What do we need to do to fix this?
Edit: After some more testing, I think that the example needs to be changed to action in PhotoFlashRole::Action::"admin"

And a section should be added to the docs showing how you can supply actions as entities to create the hierarchy for policy evaluation.

khieta added a commit that referenced this issue Jun 28, 2024
@khieta
Copy link
Contributor

khieta commented Jun 28, 2024

Thanks for filing this issue! (And apologies for the delayed reply!) I've fixed the example you mentioned in #114.

However we still don't have examples for passing actions as entities in the input hierarchy (or mention of the fact that you don't need to do this with schema-based parsing), so I'll leave the issue open for now.

@john-h-kastner-aws john-h-kastner-aws changed the title [Cedar Doc Issue] 'action in <Entity>' example is invalid cedar in the basic cedar syntax page [Cedar Doc Issue] Add examples for passing actions as entities in the input hierarchy Oct 8, 2024
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