Skip to content

Commit

Permalink
fix: load policy rule without splitting custom functions (#293)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
flynndcs and hsluoyz authored Apr 6, 2023
1 parent 66b71dc commit fbc4261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-18.04, macOS-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions casbin/persist/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def load_policy_line(line, model):
stack = []
tokens = []
for c in line:
if c == "[":
if c == "[" or c == "(":
stack.append(c)
tokens[-1] += "["
elif c == "]":
tokens[-1] += c
elif c == "]" or c == ")":
stack.pop()
tokens[-1] += "]"
tokens[-1] += c
elif c == "," and len(stack) == 0:
tokens.append("")
else:
Expand Down

0 comments on commit fbc4261

Please sign in to comment.