Skip to content

Commit

Permalink
fix: fix bug in add policy for priority effectors (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-nambiar authored Aug 10, 2023
1 parent 5e9efef commit 8d30537
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion casbin/model/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ def add_policy(self, sec, ptype, rule):
print(e)

if idx > idx_insert:
tmp = assertion.policy[i]
assertion.policy[i] = assertion.policy[i - 1]
assertion.policy[i - 1] = tmp
else:
break

assertion.policy[i] = rule
assertion.policy_map[DEFAULT_SEP.join(rule)] = i

except Exception as e:
Expand Down

0 comments on commit 8d30537

Please sign in to comment.