Skip to content

Commit 6c4c2c0

Browse files
committed
docs: fix typos in effect, config and enforcer docstrings
1 parent 52c03ab commit 6c4c2c0

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎casbin/async_enforcer.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def get_roles_for_user(self, name):
2828
return self.model.model["g"]["g"].rm.get_roles(name)
2929

3030
async def get_users_for_role(self, name):
31-
"""gets the users that has a role."""
31+
"""gets the users that have a role."""
3232
return self.model.model["g"]["g"].rm.get_users(name)
3333

3434
async def has_role_for_user(self, name, role):
@@ -233,7 +233,7 @@ async def get_roles_for_user_in_domain(self, name, domain):
233233
return self.model.model["g"]["g"].rm.get_roles(name, domain)
234234

235235
async def get_users_for_role_in_domain(self, name, domain):
236-
"""gets the users that has a role inside a domain."""
236+
"""gets the users that have a role inside a domain."""
237237
return self.model.model["g"]["g"].rm.get_users(name, domain)
238238

239239
async def add_role_for_user_in_domain(self, user, role, domain):

‎casbin/config/config.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,23 @@ def _write(self, section, line_num, b):
112112
del b[:]
113113

114114
def get_bool(self, key):
115-
"""lookups up the value using the provided key and converts the value to a bool."""
115+
"""looks up the value using the provided key and converts the value to a bool."""
116116
return self.get(key).capitalize() == "True"
117117

118118
def get_int(self, key):
119-
"""lookups up the value using the provided key and converts the value to a int"""
119+
"""looks up the value using the provided key and converts the value to an int."""
120120
return int(self.get(key))
121121

122122
def get_float(self, key):
123-
"""lookups up the value using the provided key and converts the value to a float"""
123+
"""looks up the value using the provided key and converts the value to a float."""
124124
return float(self.get(key))
125125

126126
def get_string(self, key):
127-
"""lookups up the value using the provided key and converts the value to a string"""
127+
"""looks up the value using the provided key and converts the value to a string."""
128128
return self.get(key)
129129

130130
def get_strings(self, key):
131-
"""lookups up the value using the provided key and converts the value to an array of string"""
131+
"""looks up the value using the provided key and converts the value to an array of strings."""
132132
value = self.get(key)
133133
if value == "":
134134
return None

‎casbin/effect/default_effectors.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class AllowOverrideEffector(Effector):
1919
def intermediate_effect(self, effects):
20-
"""returns a intermediate effect based on the matched effects of the enforcer"""
20+
"""returns an intermediate effect based on the matched effects of the enforcer"""
2121
if Effector.ALLOW in effects:
2222
return Effector.ALLOW
2323
return Effector.INDETERMINATE
@@ -31,7 +31,7 @@ def final_effect(self, effects):
3131

3232
class DenyOverrideEffector(Effector):
3333
def intermediate_effect(self, effects):
34-
"""returns a intermediate effect based on the matched effects of the enforcer"""
34+
"""returns an intermediate effect based on the matched effects of the enforcer"""
3535
if Effector.DENY in effects:
3636
return Effector.DENY
3737
return Effector.INDETERMINATE
@@ -45,7 +45,7 @@ def final_effect(self, effects):
4545

4646
class AllowAndDenyEffector(Effector):
4747
def intermediate_effect(self, effects):
48-
"""returns a intermediate effect based on the matched effects of the enforcer"""
48+
"""returns an intermediate effect based on the matched effects of the enforcer"""
4949
if Effector.DENY in effects:
5050
return Effector.DENY
5151
return Effector.INDETERMINATE
@@ -59,7 +59,7 @@ def final_effect(self, effects):
5959

6060
class PriorityEffector(Effector):
6161
def intermediate_effect(self, effects):
62-
"""returns a intermediate effect based on the matched effects of the enforcer"""
62+
"""returns an intermediate effect based on the matched effects of the enforcer"""
6363
if Effector.ALLOW in effects:
6464
return Effector.ALLOW
6565
if Effector.DENY in effects:

‎casbin/effect/effector.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Effector:
2323
DENY = 2
2424

2525
def intermediate_effect(self, effects):
26-
"""returns a intermediate effect based on the matched effects of the enforcer"""
26+
"""returns an intermediate effect based on the matched effects of the enforcer"""
2727
pass
2828

2929
def final_effect(self, effects):

‎casbin/enforcer.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_roles_for_user(self, name):
3737
return self.model.model["g"]["g"].rm.get_roles(name)
3838

3939
def get_users_for_role(self, name):
40-
"""gets the users that has a role."""
40+
"""gets the users that have a role."""
4141
return self.model.model["g"]["g"].rm.get_users(name)
4242

4343
def has_role_for_user(self, name, role):
@@ -242,7 +242,7 @@ def get_roles_for_user_in_domain(self, name, domain):
242242
return self.model.model["g"]["g"].rm.get_roles(name, domain)
243243

244244
def get_users_for_role_in_domain(self, name, domain):
245-
"""gets the users that has a role inside a domain."""
245+
"""gets the users that have a role inside a domain."""
246246
return self.model.model["g"]["g"].rm.get_users(name, domain)
247247

248248
def add_role_for_user_in_domain(self, user, role, domain):

‎casbin/synced_enforcer.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def get_roles_for_user(self, name):
473473
return self._e.get_roles_for_user(name)
474474

475475
def get_users_for_role(self, name):
476-
"""gets the users that has a role."""
476+
"""gets the users that have a role."""
477477
with self._rl:
478478
return self._e.get_users_for_role(name)
479479

@@ -634,7 +634,7 @@ def get_roles_for_user_in_domain(self, name, domain):
634634
return self._e.get_roles_for_user_in_domain(name, domain)
635635

636636
def get_users_for_role_in_domain(self, name, domain):
637-
"""gets the users that has a role inside a domain."""
637+
"""gets the users that have a role inside a domain."""
638638
with self._rl:
639639
return self._e.get_users_for_role_in_domain(name, domain)
640640

0 commit comments

Comments
 (0)