Skip to content

Commit

Permalink
fix: KeyError: 'g' when build_role_links
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Jun 24, 2024
1 parent b03e65a commit bf9cb44
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 bf9cb44

Please sign in to comment.