I just came across the talk “The Pit of Success for Per Object Permissions in Django” by Madelaine Boyd. The idea is to bake object level permissions checks into the orm to get pre-filtered queries. This sounds like a nice idea.
One part of the solution seems to be to overwrite
QuerySet._etch_all()
Manager.get_queryset()
Model.save()
Model.delete()
I’ve seen django-guardian
and django-rules
that implement object based permissions, but won’t enforce them on the model layer.
Is there some package available that already implements permission checks on the model layer?