Skip to content

Commit fbc4261

Browse files
flynndcshsluoyz
andauthored
fix: load policy rule without splitting custom functions (#293)
* fix: load policy rule without splitting custom functions * fix: Update adapter.py * build: update python and os for tests * fix: update CI --------- Co-authored-by: hsluoyz <hsluoyz@qq.com>
1 parent 66b71dc commit fbc4261

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ['3.7', '3.8', '3.9', '3.10']
15-
os: [ubuntu-18.04, macOS-latest, windows-latest]
14+
python-version: ['3.9', '3.10', '3.11']
15+
os: [ubuntu-latest, macOS-latest, windows-latest]
1616

1717
steps:
1818
- name: Checkout

casbin/persist/adapter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def load_policy_line(line, model):
2525
stack = []
2626
tokens = []
2727
for c in line:
28-
if c == "[":
28+
if c == "[" or c == "(":
2929
stack.append(c)
30-
tokens[-1] += "["
31-
elif c == "]":
30+
tokens[-1] += c
31+
elif c == "]" or c == ")":
3232
stack.pop()
33-
tokens[-1] += "]"
33+
tokens[-1] += c
3434
elif c == "," and len(stack) == 0:
3535
tokens.append("")
3636
else:

0 commit comments

Comments
 (0)