refactor: casl-ability-factory refactor/reduction#2748
Conversation
There was a problem hiding this comment.
Sorry @HayenNico, your pull request is larger than the review limit of 150000 diff characters
There was a problem hiding this comment.
Sorry @HayenNico, your pull request is larger than the review limit of 150000 diff characters
|
@HayenNico amazing work. I am in the process of reviewing it. |
|
...also I wonder if we need to review the authorization tests to update the existing test cases and add new ones |
|
@nitrosx I can split it into multiple files, not a problem. Let's chat at the meeting today what format/structure would be best. For tests: My main focus for now was that this passes all existing tests with no changes to the testing suite. But there's a decent chance some edge cases outside coverage behave different now. |
|
We should also discuss a strategy for merging this in general, since pretty much any open PR based on the current master will have merge conflicts with these changes since they affect every subsystem |
|
Note: It was decided that this PR will be closed and split into separate PRs for each subsystem instead. Leaving this up as draft temporarily in case someone already wants to review individual sections |
Description
This PR aims to significantly reduce the amount of code used for casl endpoint and instance authorization. Both endpoint and instance authorizations are now handled by one merged casl ability per collection, with requirements for endpoint authorization being implied from instance access rights. This includes a significant reduction in the number of actions defined for casl.
The auth logic in individual controllers has been adapted to accomodate this reduction - the core logic is preserved, but edge cases outside of test coverage may have different behavior for each collection. Hence, this PR might introduce a breaking change in such cases.
Fixes
Changes:
Possible extensions
DatasetOrigdatablockRead) via controller refactoringTests included
Documentation