link to the control panel in account view

This commit is contained in:
Laura Klünder 2017-12-08 16:01:34 +01:00
parent e2a0efd24f
commit 2b02138e39
6 changed files with 43 additions and 3 deletions

View file

@ -0,0 +1,12 @@
from django.utils.functional import SimpleLazyObject
from c3nav.control.models import UserPermissions
class UserPermissionsMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
request.user_permissions = SimpleLazyObject(lambda: UserPermissions.get_for_user(request.user))
return self.get_response(request)