-
-
Notifications
You must be signed in to change notification settings - Fork 193
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: add explicit priority support #190
Conversation
casbin/model/policy.py
Outdated
@@ -81,14 +83,39 @@ def has_policy(self, sec, ptype, rule): | |||
|
|||
return rule in self[sec][ptype].policy | |||
|
|||
def add_policy(self, sec, ptype, rule): | |||
def add_policy(self, sec, ptype, rule) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't need to think about type hint right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but without type hint sometimes it's not easy to follow and regulate the program, especially for new developers.
Maybe we can add it later in a major release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ffyuanda You can lead this style to the whole library in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zxilly Sure we can do that
@ffyuanda plz fix: |
Signed-off-by: ffyuanda <46557895+ffyuanda@users.noreply.github.com>
@techoner plz review |
@techoner updated load_policy() |
except: | ||
|
||
if self.auto_build_role_links and need_to_rebuild: | ||
self.build_role_links() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ffyuanda Here to throw the caught exception again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@techoner Just update, I catch the error and throw it after everything else.
Signed-off-by: ffyuanda <shaoxuan.yuan02@gmail.com>
# [1.9.0](v1.8.1...v1.9.0) (2021-09-25) ### Features * add explicit priority support ([#190](#190)) ([9445086](9445086))
🎉 This PR is included in version 1.9.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Match with Casbin PR: #550 and #766
Signed-off-by: ffyuanda 46557895+ffyuanda@users.noreply.github.com