pallets-eco / flask-principal

Identity management for Flask applications
MIT License
497 stars 89 forks source link

Refactor to avoid conflicts between Permission.excludes and Permission.needs #77

Closed danwuSBU closed 5 months ago

danwuSBU commented 5 months ago

We can get into a weird state with conflicting logic by doing the following:

d = Denial(('a', 'c'))
p = Permission(('a', 'c'))

u = d.union(p)
#  now u has ('a', 'c') in BOTH needs and excludes

With this refactoring, a need can be needed or excluded, but not both. This change is not expected to break anything and just handle the edge case described above.

Abdur-rahmaanJ commented 5 months ago

closes #78