def METHOD_NAME(parser, token):
    """
    Validates that the user has access permission in view
    @Example: {% has_external_perm <permission> <write> <read> %}
    :param parser:
    :param token:
    :return: Template Node
    """
    parts = token.split_contents()
    if len(parts) < 5:
        raise template.TemplateSyntaxError(
            "'has_external_perm' tag must be of the form:  {% has_perm <permission> <write> <read> <external_token>%}"
        )
    key_permission = 1
    key_write = 2
    key_read = 3
    key_token = 4
    template_node = PermissionExternal(parts[key_permission], parts[key_write], parts[key_read], parts[key_token])
    return template_node