Skip to content

Commit dcf4392

Browse files
authored
fix: #239, not allowing more than 9 types of policies/requests
1 parent a16bfaa commit dcf4392

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

casbin/util/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
def escape_assertion(s):
2222
"""escapes the dots in the assertion, because the expression evaluation doesn't support such variable names."""
23-
eval_p = re.search(r"\bp(\d?)\.", s)
23+
eval_p = re.search(r"\bp(\d*)\.", s)
2424
if eval_p is not None:
2525
p_suffix = eval_p.group(1)
2626
p_before = re.compile(f"\\bp{p_suffix}\\.")
2727
p_after = f"p{p_suffix}_"
2828
s = re.sub(p_before, p_after, s)
2929

30-
eval_r = re.search(r"\br(\d?)\.", s)
30+
eval_r = re.search(r"\br(\d*)\.", s)
3131
if eval_r is not None:
3232
r_suffix = eval_r.group(1)
3333
r_before = re.compile(f"\\br{r_suffix}\\.")

0 commit comments

Comments
 (0)