'Generates Yaml statements from security constraint information.'

def TranslateAdditionalOptions(self, h):

    additional_statements = []
    required_role = h.GetProperty('required_role', default='none')
    required_role_translation = {'none': 'optional', '*': 'required', 'admin': 'admin'}
    additional_statements.append(('        login:    %s' % required_role_translation[required_role]))
    transport_guarantee = h.GetProperty('transport_guarantee', default='none')
    if (transport_guarantee == 'none'):
        if self.app_engine_web_xml.ssl_enabled:
            additional_statements.append('        secure:    optional')
        else:
            additional_statements.append('        secure:    never')
    elif self.app_engine_web_xml.ssl_enabled:
        additional_statements.append('        secure:    always')
    else:
        raise AppEngineConfigException('SSL    must    be    enabled    in    appengine-web.xml    to    use    transport-guarantee')
    handler_id = self.web_xml.pattern_to_id.get(h.pattern)
    if (handler_id and (handler_id in self.app_engine_web_xml.api_endpoints)):
        additional_statements.append('        api_endpoint:    True')
    return additional_statements
