Skip to content

Commit

Permalink
Merge pull request #351 from casbin/develop
Browse files Browse the repository at this point in the history
fix: KeyError: 'g' when build_role_links
  • Loading branch information
leeqvip committed Jun 24, 2024
2 parents b03e65a + bf9cb44 commit 0199a34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions casbin/model/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def build_role_links(self, rm_map):
return

for ptype, ast in self["g"].items():
rm = rm_map[ptype]
ast.build_role_links(rm)
rm = rm_map.get(ptype)
if rm:
ast.build_role_links(rm)

def build_incremental_role_links(self, rm, op, sec, ptype, rules):
if sec == "g":
Expand Down

0 comments on commit 0199a34

Please sign in to comment.