def METHOD_NAME(grant_target_name, user_name, node=None):
    """Run scenarios to check the user's access with different privileges.
    """
    exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
    with Scenario("user without privilege"):
        table_name = f"table_{getuid()}"
        try:
            with When("I grant the user NONE privilege"):
                node.query(f"GRANT NONE TO {grant_target_name}")
            with And("I grant the user USAGE privilege"):
                node.query(f"GRANT USAGE ON *.* TO {grant_target_name}")
            with Then("I attempt to attach a table without privilege"):
                node.query(f"ATTACH TABLE {table_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I drop the  table"):
                node.query(f"DROP TABLE IF EXISTS {table_name}")
    with Scenario("user with privilege"):
        table_name = f"table_{getuid()}"
        try:
            with When("I grant create table privilege"):
                node.query(f"GRANT CREATE TABLE ON *.* TO {grant_target_name}")
            with Then("I attempt to attach a table"):
                node.query(f"ATTACH TABLE {table_name}", settings = [("user", user_name)],
                    exitcode=134, message=f"DB::Exception: Table `{table_name}` doesn't exist.")
        finally:
            with Finally("I drop the table"):
                node.query(f"DROP TABLE IF EXISTS {table_name}")
    with Scenario("user with revoked privilege"):
        table_name = f"table_{getuid()}"
        try:
            with When("I grant the create  table privilege"):
                node.query(f"GRANT CREATE TABLE ON *.* TO {grant_target_name}")
            with And("I revoke the create table privilege"):
                node.query(f"REVOKE CREATE TABLE ON *.* FROM {grant_target_name}")
            with Then("I attempt to attach a table"):
                node.query(f"ATTACH TABLE {table_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I drop the table"):
                node.query(f"DROP TABLE IF EXISTS {table_name}")
    with Scenario("user with revoked ALL privilege"):
        table_name = f"table_{getuid()}"
        try:
            with When("I grant the create  table privilege"):
                node.query(f"GRANT CREATE TABLE ON *.* TO {grant_target_name}")
            with And("I revoke ALL privilege"):
                node.query(f"REVOKE ALL ON *.* FROM {grant_target_name}")
            with Then("I attempt to attach a table"):
                node.query(f"ATTACH TABLE {table_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I drop the table"):
                node.query(f"DROP TABLE IF EXISTS {table_name}")
    with Scenario("user with ALL privilege"):
        table_name = f"table_{getuid()}"
        try:
            with When("I grant ALL privilege"):
                node.query(f"GRANT ALL ON *.* TO {grant_target_name}")
            with Then("I attempt to attach a table"):
                node.query(f"ATTACH TABLE {table_name}", settings = [("user", user_name)],
                    exitcode=134, message=f"DB::Exception: Table `{table_name}` doesn't exist.")
        finally:
            with Finally("I drop the table"):
                node.query(f"DROP TABLE IF EXISTS {table_name}")