GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — Introduce ActionPolicy authorization adapter by amkisko · Pull Request #8708 · activeadmin/activeadmin ConversationThis PR introduces a new ActiveAdmin::ActionPolicyAdapter to enable integration with the Action Policy authorization framework. The adapter implements both #authorized? and #scope_collection methods, mapping ActiveAdmin’s internal permissions to Action Policy’s rules and scopes. ActiveAdmin supports a pluggable authorization system, but out of the box, it only provides adapters for popular frameworks like Pundit and CanCanCan. As more teams adopt Action Policy for its performance, flexibility, and first-class Rails support, it’s increasingly desirable to make ActiveAdmin compatible with it out of the box. References:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
References: - https://gist.github.com/amkisko/c704c1a6462d573dfa4820ae07d807a6 - actionpolicy.evilmartians.io This commit introduces the ActionPolicy adapter for ActiveAdmin, allowing for flexible authorization management. The ActionPolicy gem is added to the Gemfile, and relevant documentation is updated to guide users on configuring the adapter. Additionally, new policy templates are included to demonstrate usage. Ref: https://actionpolicy.evilmartians.io
|
There was an error while loading. Please reload this page.
|
@tagliala @javierjulio Hey! Here's better PR for review and discussion. There is one critical thing to figure out is how to organize test templates as they are intersecting with Pundit. I suggested the option, but really I don't like it at this point, but it should work. Also I could not figure out yet what is missing on my machine for running rspec, tests are not checked. And sure before merging squashing required (so that you can edit commit message to the preferred format) or I can recreate it again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hello,
Thanks for this PR.
Also I could not figure out yet what is missing on my machine for running rspec, tests are not checked.
Maybe something related to bundler? I've seen the removal of ruby, so I guess that build native extensions is somehow not working.
Run specs with just CI=1 rake, that will create the test app and proceed with all the specs
First comments:
313 files inspected, 17 offenses detected, 17 offenses autocorrectable
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| PLATFORMS | ||
| arm64-darwin | ||
| ruby |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please remove this change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I saw this one, it was automatically modified by bundler locally.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…nto patch/action-policy-adapter
- Removed platform specification for sqlite3 in multiple Gemfiles. - Updated action_policy version from 0.7.4 to 0.7.5 in Gemfile.lock across all Rails versions. - Adjusted Bundler version in Gemfile.lock to 2.7.2. These changes ensure compatibility and streamline the dependency management.
…anagement - Added frozen string literal to improve performance. - Refactored `authorized?` and `scope_collection` methods for better clarity and functionality. - Improved error handling in `retrieve_policy` to provide more informative messages. - Updated tests to reflect changes in policy initialization and scoping behavior. - Added frozen string literal to user policy template for consistency. These changes enhance the robustness and maintainability of the ActionPolicyAdapter.
- Updated the test for differentiating between `:new` and `:create` abilities to improve clarity. - Added tests to ensure proper authorization behavior for new post instances. - Introduced a context to handle cases where the default policy does not exist, ensuring appropriate error handling. These changes enhance the robustness of the ActionPolicyAdapter tests and improve error management.
This bug was quite invisible and affected all scopes as normally non-administrator users do not have access to ActiveAdmin and the area assumed to be safe.
…nto patch/action-policy-adapter
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.