Skip to content

Commit c3c3c78

Browse files
committed
fix(policy): update policy_map by calling add_policy for each rule
1 parent 963115b commit c3c3c78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: casbin/model/policy.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def add_policies(self, sec, ptype, rules):
154154
return False
155155

156156
for rule in rules:
157-
self[sec][ptype].policy.append(rule)
157+
if not self.add_policy(sec, ptype, rule):
158+
return False
158159

159160
return True
160161

0 commit comments

Comments
 (0)