Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support load policy from text #372

Merged
merged 4 commits into from
Oct 29, 2024
Merged

Conversation

Taoyuesong
Copy link
Contributor

@Taoyuesong Taoyuesong commented Sep 23, 2024

close #371

This issue will be add new Text Adapter.

@casbin-bot
Copy link
Member

@sagilio please review

@casbin-bot casbin-bot requested a review from sagilio September 23, 2024 02:06
Copy link
Member

@sagilio sagilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is not suitable to provide multiple modes in the FileAdapter, but rather to provide different Adapters.

You can try to use the existing FileAdapter as a base class and extend it to create File, Stream, and Text three types of Adapters.

Casbin.UnitTests/ModelTests/EnforcerTest.cs Outdated Show resolved Hide resolved
Signed-off-by: Taoyuesong <tao634774653@gmail.com>
Signed-off-by: Taoyuesong <tao634774653@gmail.com>
Signed-off-by: Taoyuesong <tao634774653@gmail.com>
Signed-off-by: Taoyuesong <tao634774653@gmail.com>
@sagilio sagilio self-requested a review October 29, 2024 12:40
Copy link
Member

@sagilio sagilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sagilio sagilio merged commit 85b9330 into casbin:master Oct 29, 2024
8 checks passed
Copy link

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support load policy text from adapter
3 participants