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] is in scope doesn't work #84

Closed
apexskier opened this issue Feb 8, 2024 · 3 comments
Closed

[Cedar Doc Issue] is in scope doesn't work #84

apexskier opened this issue Feb 8, 2024 · 3 comments

Comments

@apexskier
Copy link

What were you trying to do?

I want to use the is syntax to constrain a policy to a type of entity.

In the playground, I set a policy:

permit (
    principal is PhotoApp::User,
    action == PhotoApp::Action::"viewPhoto",
    resource == PhotoApp::Photo::"vacationPhoto.jpg"
);

What is wrong and why?

This results in the error:

Unrecognized token `is` found at 23:25 Expected one of "!=", "%", "&&", "(", ")", "*", "+", ",", "-", ".", "/", ":", "::", "<", "<=", "==", ">", ">=", "[", "]", "{", "||", "}", ELSE, HAS, IN, LIKE or THEN
Cedar Language Playground - Google Chrome - 2024-02-08 at 15 11 45@2x

According to

//matches any principal of type User
, this is allowed.

What do we need to do to fix this?

Either fix the source to ensure this is allowed, or update the docs to clarify it's not.

This works in the when body of a policy, but the docs imply strongly to me it works in the scope since it's nested within the #term-policy-scope section.

@apexskier
Copy link
Author

@mwhicks1
Copy link
Contributor

mwhicks1 commented Feb 8, 2024

Hi apexskier -- The Cedar playground is running an older version of Cedar -- 2.4.3 if I recall correctly. If you try your example using the command-line interface with version 3.0.x it should work.

@mwhicks1
Copy link
Contributor

Closing this issue as it is not a docs issue, but rather a difference between the Cedar playground (running 2.4.3) and the docs version (3.0.1). Added issue #85 to host older versions of docs, especially those on the playground.

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