def whitelist(allow_guest=False, xss_safe=False):
 def innerfn(fn):
  global whitelisted, guest_methods, xss_safe_methods
  whitelisted.append(fn)
  if allow_guest:
   guest_methods.append(fn)
   if xss_safe:
    xss_safe_methods.append(fn)
  return fn
 return innerfn

def whitelist ( allow_guest = False , xss_safe = False ) : def innerfn ( fn ) : global whitelisted , guest_methods , xss_safe_methods whitelisted . append ( fn ) if allow_guest : guest_methods . append ( fn ) if xss_safe : xss_safe_methods . append ( fn ) return fn return innerfn
returns a function that operates as a whitelist for the provided list of fields .