Skip to content

Commit

Permalink
fix: fix bug in add policy for priority effectors
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-nambiar committed Aug 10, 2023
1 parent 5e9efef commit 57ee4eb
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 57ee4eb

Please sign in to comment.