Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

May 16, 2012

Allowing only super user login decorator

from django.contrib.auth.decorators import user_passes_test

@user_passes_test(lambda u: u.is_superuser)
def foo_view(request):
    ....