'Pulls data from the security constraint node and adds to WebXml object.
Args:
node: An ElementTree Xml node that looks something like the following:
<security-constraint>
<web-resource-collection>
<url-pattern>/profile/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>'

def ProcessSecurityConstraintNode(self, node):

    security_constraint = SecurityConstraint()
    resources_node = xml_parser_utils.GetChild(node, 'web-resource-collection')
    security_constraint.patterns = [sub_node.text for sub_node in xml_parser_utils.GetNodes(resources_node, 'url-pattern')]
    constraint = xml_parser_utils.GetChild(node, 'auth-constraint')
    if (constraint is not None):
        role_name = xml_parser_utils.GetChildNodeText(constraint, 'role-name').lower()
        if role_name:
            if (role_name not in ('none', '*', 'admin')):
                self.errors.append(('Bad    value    for    <role-name>    (%s),    must    be    none,    *,    or    admin' % role_name))
            security_constraint.required_role = role_name
    user_constraint = xml_parser_utils.GetChild(node, 'user-data-constraint')
    if (user_constraint is not None):
        guarantee = xml_parser_utils.GetChildNodeText(user_constraint, 'transport-guarantee').lower()
        if (guarantee not in ('none', 'integral', 'confidential')):
            self.errors.append(('Bad    value    for    <transport-guarantee>    (%s),    must    be    none,    integral,    or    confidential' % guarantee))
        security_constraint.transport_guarantee = guarantee
    self.web_xml.security_constraints.append(security_constraint)
