## Python Script "getAnonymailerDefault"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Determine appropriate default value for 'send mail anonymously' option

mem = context.portal_membership.getAuthenticatedMember()
prop_name = 'useAnonByDefault'
mem_setting = mem.getProperty(prop_name, None)
if mem_setting is not None:
    ret = mem_setting
else:
    anon_tool = context.portal_anonymailer
    site_setting = anon_tool.getField(prop_name).getAccessor(anon_tool)()
    ret = site_setting
return ret
