feat: add LoadPolicy API to load policies from database on startup#59
Merged
feat: add LoadPolicy API to load policies from database on startup#59
Conversation
|
|
- Add EnforcerServer.load_policies/1 to load from configured adapter - Add EnforcerServer.load_mapping_policies/1 to load mapping policies from adapter - Add corresponding GenServer handlers - Create comprehensive test suite for new functionality - Maintain backward compatibility with file-based loading (load_policies/2) - Add documentation and examples Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
- Add "Persisting Policies to Database with EctoAdapter" section - Document database setup and migration - Show how to load policies from database on startup - Demonstrate auto-persist behavior - Provide production application startup pattern - Include examples for both ACL and RBAC models Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
- Add transaction/1 support to MockRepo - Enables save_policies testing which uses transactions - Supports both 0-arity and 1-arity transaction functions Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add auto-load functionality for policies in EctoAdapter
Add LoadPolicy API to load policies from database on startup
Jan 1, 2026
Member
|
@copilot fix: |
- Run mix format on test/persist/ecto_server_load_test.exs - Remove trailing whitespace to comply with Elixir formatting standards - Fixes CI build failure from mix format --check-formatted Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Contributor
Author
... Fixed in commit 3825d72. Ran |
|
🎉 This PR is included in version 1.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or 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
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.
fix: #30