From 576359e047f52d91af987409ea8219fb00b21179 Mon Sep 17 00:00:00 2001 From: Nekotoxin Date: Sun, 28 Aug 2022 12:27:51 +0800 Subject: [PATCH] fix: some typos --- casbin/management_enforcer.py | 6 +++--- casbin/synced_enforcer.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/casbin/management_enforcer.py b/casbin/management_enforcer.py index 12480d77..faacdf8e 100644 --- a/casbin/management_enforcer.py +++ b/casbin/management_enforcer.py @@ -213,7 +213,7 @@ def add_grouping_policy(self, *params): return self.add_named_grouping_policy("g", *params) def add_grouping_policies(self, rules): - """adds role inheritance rulea to the current policy. + """adds role inheritance rules to the current policy. If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added. Otherwise the function returns true for the corresponding policy rule by adding the new rule. @@ -241,7 +241,7 @@ def add_named_grouping_policy(self, ptype, *params): return rule_added def add_named_grouping_policies(self, ptype, rules): - """ "adds named role inheritance rules to the current policy. + """adds named role inheritance rules to the current policy. If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added. Otherwise the function returns true for the corresponding policy rule by adding the new rule.""" @@ -256,7 +256,7 @@ def remove_grouping_policy(self, *params): return self.remove_named_grouping_policy("g", *params) def remove_grouping_policies(self, rules): - """removes role inheritance rulea from the current policy.""" + """removes role inheritance rules from the current policy.""" return self.remove_named_grouping_policies("g", rules) def remove_filtered_grouping_policy(self, field_index, *field_values): diff --git a/casbin/synced_enforcer.py b/casbin/synced_enforcer.py index 8c063d6e..59823184 100644 --- a/casbin/synced_enforcer.py +++ b/casbin/synced_enforcer.py @@ -587,7 +587,7 @@ def remove_named_policies(self, ptype, rules): return self._e.remove_named_policies(ptype, rules) def add_grouping_policies(self, rules): - """adds role inheritance rulea to the current policy. + """adds role inheritance rules to the current policy. If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added. Otherwise the function returns true for the corresponding policy rule by adding the new rule. @@ -604,7 +604,7 @@ def add_named_grouping_policies(self, ptype, rules): return self._e.add_named_grouping_policies(ptype, rules) def remove_grouping_policies(self, rules): - """removes role inheritance rulea from the current policy.""" + """removes role inheritance rules from the current policy.""" with self._wl: return self._e.addremove_grouping_policies_policies(rules)