-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add limited support for mixed operators #107
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rhamzeh
commented
Nov 13, 2023
90a82a0
to
46d2f2c
Compare
d-jeffery
reviewed
Nov 17, 2023
tests/data/transformer/14-mixed-operators/authorization-model.json
Outdated
Show resolved
Hide resolved
46d2f2c
to
70d831a
Compare
d-jeffery
reviewed
Nov 22, 2023
rhamzeh
commented
Nov 27, 2023
Nevermind, think i got it. |
adriantam
reviewed
Dec 8, 2023
2f83e5e
to
aed88a0
Compare
adriantam
approved these changes
Dec 11, 2023
adriantam
approved these changes
Dec 11, 2023
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds initial support for mixed operators
Description
Cases to be supported (both from and to DSL)
(with no direct assignment):
define relation: (rel1 and rel2) but not rel3
define relation: ((rel1 and rel2) but not rel3)
# transformation back to DSL will not keep the extraneous surrounding bracketsdefine relation: rel1 and (rel2 but not rel3)
define relation: rel1 and ((rel2 but not rel3) or (rel4 and (rel5 but not rel6 from rel7)))
(with direct assignment, only if there is a single reference to the assignment and only if it is the first entry):
define relation: [user, user:*, user#follower with condition] or ((rel1 and rel2) but not rel3)
define relation: ([user] or ((rel1 and rel2)) but not rel3
# Note we can de-prioritize this as pending discussionCases NOT planned to supported yet, pending discussion:
Anything involving multiple references to direct assignment, or the presence of direct assignment not as the first entry, or references to
self/this
:define relation: [user] as self | rel1 but not self
define relation: [user] as self | this but not rel1
define relation: rel1 but not [user]
define relation: [user] as self | (self or ((rel1 and rel2)) but not rel3
define relation: (rel3 or ((rel1 and rel2)) but not [user]
define relation: (rel3 or (([user] and rel2)) but not self
define relation: ([user] and allowed) or ([user] but not blocked]
References
Review Checklist
main