Repository navigation
fix: remove legacy authz policy and action grouping - #538
mariajgrimaldi wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @mariajgrimaldi! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
a60df55 to
bb1563c
Compare
bb1563c to
40ad803
Compare
40ad803 to
94bde0d
Compare
94bde0d to
4f87391
Compare
There was a problem hiding this comment.
Thanks for this work, I have some concerns about removing g2 support tough:
This is what I had in mind originally for this ticket: Just remove the p entries from authz.policy and keep g2 for now as this is not represented in yaml currently.
Then, on #523 I was planning on modeling the permission dependencies in the yaml schema and update the compiler so it would output g2 rows based on the yaml definition.
The idea was that we would use the information from those rows to imply dependencies to be latter shown to the end user in the UI wizard when defining custom roles, so it's clear that enabling one permission implies others (when defined).
Alternatively if we remove g2, then defining the permission dependencies in YAML wouldn't have any effect at the casbin level, but only on the UI level which would then assign each permission and its dependencies one by one to a role.
I'm not 100% sure what's the best path forward, what do you think?
Description
Static role-permission policies now come from the authorization schema, so this removes
authz.policyalong withg2action grouping from the Casbin model and deletes the existingg2rows through a data migration. The built-in roles already list every permission covered by those relationships and the tests now verify those explicit assignments, which means this is not a breaking change for supported configurations.Permission grouping and role inheritance remain outside the authorization schema, with that work tracked in #91 and #523.
load_policiesremains available because Tutor still calls it during LMS and CMS initialization, although calls without a policy file now do nothing. Open PR overhangio/tutor#1496 addsload_authz_schema, so it can be extended to remove theload_policiescalls or overhangio/tutor#1509 can make that change separately. Issue #539 tracks whether the explicit custom-file workflow remains supported as is and whether the command should be removed after the Tutor change is released.Solves #462
How to Test
Run:
These commands run as usual without loading policy rows from a file. In a clean database,
load_policiesexits successfully without a policy file, the schema command loads 132prows and nog2rows, and a second run reports no changes.