This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-pycasbin.git
The following commit(s) were added to refs/heads/master by this push:
new 6c4c2c0 docs: fix typos in effect, config and enforcer docstrings
6c4c2c0 is described below
commit 6c4c2c0706d287fca19eb8f6d2139b09235031b2
Author: Yang Luo <[email protected]>
AuthorDate: Wed Sep 23 14:16:42 2026 +0800
docs: fix typos in effect, config and enforcer docstrings
---
casbin/async_enforcer.py | 4 ++--
casbin/config/config.py | 10 +++++-----
casbin/effect/default_effectors.py | 8 ++++----
casbin/effect/effector.py | 2 +-
casbin/enforcer.py | 4 ++--
casbin/synced_enforcer.py | 4 ++--
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/casbin/async_enforcer.py b/casbin/async_enforcer.py
index f61322f..fd4050d 100644
--- a/casbin/async_enforcer.py
+++ b/casbin/async_enforcer.py
@@ -28,7 +28,7 @@ class AsyncEnforcer(AsyncManagementEnforcer):
return self.model.model["g"]["g"].rm.get_roles(name)
async def get_users_for_role(self, name):
- """gets the users that has a role."""
+ """gets the users that have a role."""
return self.model.model["g"]["g"].rm.get_users(name)
async def has_role_for_user(self, name, role):
@@ -233,7 +233,7 @@ class AsyncEnforcer(AsyncManagementEnforcer):
return self.model.model["g"]["g"].rm.get_roles(name, domain)
async def get_users_for_role_in_domain(self, name, domain):
- """gets the users that has a role inside a domain."""
+ """gets the users that have a role inside a domain."""
return self.model.model["g"]["g"].rm.get_users(name, domain)
async def add_role_for_user_in_domain(self, user, role, domain):
diff --git a/casbin/config/config.py b/casbin/config/config.py
index 30299b4..74160ed 100644
--- a/casbin/config/config.py
+++ b/casbin/config/config.py
@@ -112,23 +112,23 @@ class Config:
del b[:]
def get_bool(self, key):
- """lookups up the value using the provided key and converts the value
to a bool."""
+ """looks up the value using the provided key and converts the value to
a bool."""
return self.get(key).capitalize() == "True"
def get_int(self, key):
- """lookups up the value using the provided key and converts the value
to a int"""
+ """looks up the value using the provided key and converts the value to
an int."""
return int(self.get(key))
def get_float(self, key):
- """lookups up the value using the provided key and converts the value
to a float"""
+ """looks up the value using the provided key and converts the value to
a float."""
return float(self.get(key))
def get_string(self, key):
- """lookups up the value using the provided key and converts the value
to a string"""
+ """looks up the value using the provided key and converts the value to
a string."""
return self.get(key)
def get_strings(self, key):
- """lookups up the value using the provided key and converts the value
to an array of string"""
+ """looks up the value using the provided key and converts the value to
an array of strings."""
value = self.get(key)
if value == "":
return None
diff --git a/casbin/effect/default_effectors.py
b/casbin/effect/default_effectors.py
index 7e5ae57..6d327e4 100644
--- a/casbin/effect/default_effectors.py
+++ b/casbin/effect/default_effectors.py
@@ -17,7 +17,7 @@ from .effector import Effector
class AllowOverrideEffector(Effector):
def intermediate_effect(self, effects):
- """returns a intermediate effect based on the matched effects of the
enforcer"""
+ """returns an intermediate effect based on the matched effects of the
enforcer"""
if Effector.ALLOW in effects:
return Effector.ALLOW
return Effector.INDETERMINATE
@@ -31,7 +31,7 @@ class AllowOverrideEffector(Effector):
class DenyOverrideEffector(Effector):
def intermediate_effect(self, effects):
- """returns a intermediate effect based on the matched effects of the
enforcer"""
+ """returns an intermediate effect based on the matched effects of the
enforcer"""
if Effector.DENY in effects:
return Effector.DENY
return Effector.INDETERMINATE
@@ -45,7 +45,7 @@ class DenyOverrideEffector(Effector):
class AllowAndDenyEffector(Effector):
def intermediate_effect(self, effects):
- """returns a intermediate effect based on the matched effects of the
enforcer"""
+ """returns an intermediate effect based on the matched effects of the
enforcer"""
if Effector.DENY in effects:
return Effector.DENY
return Effector.INDETERMINATE
@@ -59,7 +59,7 @@ class AllowAndDenyEffector(Effector):
class PriorityEffector(Effector):
def intermediate_effect(self, effects):
- """returns a intermediate effect based on the matched effects of the
enforcer"""
+ """returns an intermediate effect based on the matched effects of the
enforcer"""
if Effector.ALLOW in effects:
return Effector.ALLOW
if Effector.DENY in effects:
diff --git a/casbin/effect/effector.py b/casbin/effect/effector.py
index 71251de..f50f312 100644
--- a/casbin/effect/effector.py
+++ b/casbin/effect/effector.py
@@ -23,7 +23,7 @@ class Effector:
DENY = 2
def intermediate_effect(self, effects):
- """returns a intermediate effect based on the matched effects of the
enforcer"""
+ """returns an intermediate effect based on the matched effects of the
enforcer"""
pass
def final_effect(self, effects):
diff --git a/casbin/enforcer.py b/casbin/enforcer.py
index 7b7b3be..bc8c6be 100644
--- a/casbin/enforcer.py
+++ b/casbin/enforcer.py
@@ -37,7 +37,7 @@ class Enforcer(ManagementEnforcer):
return self.model.model["g"]["g"].rm.get_roles(name)
def get_users_for_role(self, name):
- """gets the users that has a role."""
+ """gets the users that have a role."""
return self.model.model["g"]["g"].rm.get_users(name)
def has_role_for_user(self, name, role):
@@ -242,7 +242,7 @@ class Enforcer(ManagementEnforcer):
return self.model.model["g"]["g"].rm.get_roles(name, domain)
def get_users_for_role_in_domain(self, name, domain):
- """gets the users that has a role inside a domain."""
+ """gets the users that have a role inside a domain."""
return self.model.model["g"]["g"].rm.get_users(name, domain)
def add_role_for_user_in_domain(self, user, role, domain):
diff --git a/casbin/synced_enforcer.py b/casbin/synced_enforcer.py
index a10a57f..8e5e028 100644
--- a/casbin/synced_enforcer.py
+++ b/casbin/synced_enforcer.py
@@ -473,7 +473,7 @@ class SyncedEnforcer:
return self._e.get_roles_for_user(name)
def get_users_for_role(self, name):
- """gets the users that has a role."""
+ """gets the users that have a role."""
with self._rl:
return self._e.get_users_for_role(name)
@@ -634,7 +634,7 @@ class SyncedEnforcer:
return self._e.get_roles_for_user_in_domain(name, domain)
def get_users_for_role_in_domain(self, name, domain):
- """gets the users that has a role inside a domain."""
+ """gets the users that have a role inside a domain."""
with self._rl:
return self._e.get_users_for_role_in_domain(name, domain)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]