parameters: (function)
return_statement: return _inner
docstring: Decorator that forces a view to be accessible by SUPERUSERS only.
docstring_summary: Decorator that forces a view to be accessible by SUPERUSERS only.
docstring_tokens: Decorator that forces a view to be accessible by SUPERUSERS only .
function: def superuser_protected(function):
      """Decorator that forces a view to be accessible by SUPERUSERS only.
      """
      def _inner(request, *args, **kwargs):
          if not auth.get_user(request).is_superuser:
              return HttpResponse(
                  json.dumps({
                      'error': 'unauthorized_request'
                  }),
                  status=403,
                  content_type="application/json"
              )
          return function(request, *args, **kwargs)
      return _inner
function_tokens: def superuser_protected ( function ) : def _inner ( request , * args , * * kwargs ) : if not auth . get_user ( request ) . is_superuser : return HttpResponse ( json . dumps ( { 'error' : 'unauthorized_request' } ) , status = 403 , content_type = "application/json" ) return function ( request , * args , * * kwargs ) return _inner