code: def staff_member_required(request):
      "Lookup decorator to require the user is a staff member."
      user = getattr(request, 'user', None)
      if user is None or not user.is_authenticated:
          return HttpResponse(status=401) # Unauthorized
      elif not user.is_staff:
          return HttpResponseForbidden(f staff_member_required(request):
      "Lookup decorator to require the user is a staff member."
      user = getattr(request, 'user', None)
      if user is None or not user.is_authenticated:
          return HttpResponse(status=401) # Unauthorized
      elif not user.is_staff:
          return HttpResponseForbidden()
docs: Lookup decorator to require the user is a staff member.