Re: Looking for feedback on implementation of UserManager.with_perm()

2016-09-16 Thread Nick Pope
Hi Berker, I just wanted to highlight my comment on the PR here for the benefit of those discussing this: https://github.com/django/django/pull/7153#issuecomment-242672721 We currently horribly abuse the existing permission system to add additional global permissions in a hacky way by

Looking for feedback on implementation of UserManager.with_perm()

2016-09-13 Thread Berker Peksağ
https://github.com/django/django/pull/7153/ implements UserManager.with_perm() [1] as: def with_perm(self, perm): for backend in auth.get_backends(): if hasattr(backend, 'with_perm'): return backend.with_perm(perm) return self.get_queryset().none()