def restclient_admin_required(view_func):
def wrapper(request, *args, **kwargs):<EOL><INDENT>template = '<STR_LIT>'<EOL>if hasattr(settings, '<STR_LIT>'):<EOL><INDENT>auth_func = import_string(settings.RESTCLIENTS_ADMIN_AUTH_MODULE)<EOL><DEDENT>else:<EOL><INDENT>context = {'<STR_LIT>': (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")}<EOL>return render(request, template, context=context, status=<NUM_LIT>)<EOL><DEDENT>service = args[<NUM_LIT:0>] if len(args) > <NUM_LIT:0> else None<EOL>url = args[<NUM_LIT:1>] if len(args) > <NUM_LIT:1> else None<EOL>if auth_func(request, service, url):<EOL><INDENT>return view_func(request, *args, **kwargs)<EOL><DEDENT>return render(request, template, status=<NUM_LIT>)<EOL><DEDENT>return login_required(function=wrapper)<EOL>
View decorator that checks whether the user is permitted to view proxy
restclients. Calls login_required in case the user is not authenticated.