keto
keto copied to clipboard
feat: compare this with ctx.subject (#1204)
In the conversation for #1204, @hperl commented:
From an implementation point of view, this would require:
- adding support for this expression in the OPL parser
- adding a new userset rewrites type (maybe
SubjectEqualsObject
), and attach it to the relation if we parsed the expression- implement the
SubjectEqualsObject
rewrite in the check engine (simple, just compare object and subject for a given relation tuple)Of course, add tests to make sure your change was effective, and run the fuzzers if you touch parser code.
This PR addresses the above suggested implementation and adds the related feature.
Related issue(s)
#1204
Checklist
- [x] I have read the contributing guidelines.
- [x] I have referenced an issue containing the design document if my change introduces a new feature.
- [x] I am following the contributing code guidelines.
- [x] I have read the security policy.
- [x] I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security vulnerability, I confirm that I got the approval (please contact [email protected]) from the maintainers to push the changes.
- [x] I have ~added~ updated tests that prove my fix is effective or that my feature works.
- [ ] I have added or changed the documentation.
Further Comments
I will amend this PR to update/add to the documentation regarding this new feature.