def METHOD_NAME(grant_option_target, grant_target, user_name, table_type, privilege, node=None):
    """Run different scenarios to check the user's access with different privileges.
    """
    exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
    with Scenario("grant by user without privilege", setup=instrument_clickhouse_server_log):
        table_name = f"merge_tree_{getuid()}"
        with table(node, name=table_name, table_type_name=table_type):
            with Then("I attempt to grant delete privilege without privilege"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_target}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
    with Scenario("grant by user with grant option privilege", setup=instrument_clickhouse_server_log):
        table_name = f"merge_tree_{getuid()}"
        with table(node, name=table_name, table_type_name=table_type):
            with When("I grant delete privilege"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_option_target} WITH GRANT OPTION")
            with Then("I attempt to grant delete privilege"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_target}", settings = [("user", user_name)])
    with Scenario("revoke by user with grant option privilege", setup=instrument_clickhouse_server_log):
        table_name = f"merge_tree_{getuid()}"
        with table(node, name=table_name, table_type_name=table_type):
            with When("I grant delete privilege"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_option_target} WITH GRANT OPTION")
            with Then("I attempt to revoke delete privilege"):
                node.query(f"REVOKE {privilege} ON {table_name} FROM {grant_target}", settings = [("user", user_name)])
    with Scenario("grant by user with revoked grant option privilege", setup=instrument_clickhouse_server_log):
        table_name = f"merge_tree_{getuid()}"
        with table(node, name=table_name, table_type_name=table_type):
            with When(f"I grant delete privilege with grant option to {grant_option_target}"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_option_target} WITH GRANT OPTION")
            with And(f"I revoke delete privilege with grant option from {grant_option_target}"):
                node.query(f"REVOKE {privilege} ON {table_name} FROM {grant_option_target}")
            with Then("I attempt to grant delete privilege"):
                node.query(f"GRANT {privilege} ON {table_name} TO {grant_target}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)