<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_command( principal, permissions, endpoint_plus_path, notify_email, notify_message ):
 """ Executor for `globus endpoint permission create` """

    if not principal:
        raise click.UsageError("A security principal is required for this command")

    endpoint_id, path = endpoint_plus_path
    principal_type, principal_val = principal

    client = get_client()

    if principal_type == "identity":
        principal_val = maybe_lookup_identity_id(principal_val)
        if not principal_val:
            raise click.UsageError(
                "Identity does not exist. "
                "Use --provision-identity to auto-provision an identity."
            )
    elif principal_type == "provision-identity":
        principal_val = maybe_lookup_identity_id(principal_val, provision=True)
        principal_type = "identity"

    if not notify_email:
        notify_message = None

    rule_data = assemble_generic_doc(
        "access",
        permissions=permissions,
        principal=principal_val,
        principal_type=principal_type,
        path=path,
        notify_email=notify_email,
        notify_message=notify_message,
    )

    res = client.add_endpoint_acl_rule(endpoint_id, rule_data)
    formatted_print(
        res,
        text_format=FORMAT_TEXT_RECORD,
        fields=[("Message", "message"), ("Rule ID", "access_id")],
    )