def admin_required(reviewers=False):
 def decorator(f):
  @login_required
  @functools.wraps(f)
  def wrapper(request, *args, **kw):
   admin = (action_allowed(request, 'Admin', '%') or action_allowed(request, 'AdminTools', 'View'))
   if (reviewers is True):
    admin = (admin or action_allowed(request, 'ReviewerAdminTools', 'View'))
   if admin:
    return f(request, *args, **kw)
   raise PermissionDenied
  return wrapper
 if callable(reviewers):
  return decorator(reviewers)
 else:
  return decorator

def admin_required ( reviewers = False ) : def decorator ( f ) : @ login_required @ functools . wraps ( f ) def wrapper ( request , * args , ** kw ) : admin = ( action_allowed ( request , 'Admin' , '%' ) or action_allowed ( request , 'AdminTools' , 'View' ) ) if ( reviewers is True ) : admin = ( admin or action_allowed ( request , 'ReviewerAdminTools' , 'View' ) ) if admin : return f ( request , * args , ** kw ) raise PermissionDenied return wrapper if callable ( reviewers ) : return decorator ( reviewers ) else : return decorator
requires app engine admin credentials .