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"):
        view_name = f"view_{getuid()}"
        try:
            with Given("I have a view"):
                node.query(f"CREATE VIEW {view_name} AS SELECT 1")
            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 When("I attempt to drop a view without privilege"):
                node.query(f"DETACH VIEW {view_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I reattach the view as a table", flags=TE):
                node.query(f"ATTACH VIEW IF NOT EXISTS {view_name} AS SELECT 1")
            with And("I drop the view", flags=TE):
                node.query(f"DROP VIEW IF EXISTS {view_name}")
    with Scenario("user with privilege"):
        view_name = f"view_{getuid()}"
        try:
            with Given("I have a view"):
                node.query(f"CREATE VIEW {view_name} AS SELECT 1")
            with When("I grant drop view privilege"):
                node.query(f"GRANT DROP VIEW ON {view_name} TO {grant_target_name}")
            with Then("I attempt to drop a view"):
                node.query(f"DETACH VIEW {view_name}", settings = [("user", user_name)])
        finally:
            with Finally("I reattach the view as a table", flags=TE):
                node.query(f"ATTACH VIEW IF NOT EXISTS {view_name} AS SELECT 1")
            with And("I drop the table", flags=TE):
                node.query(f"DROP VIEW IF EXISTS {view_name}")
    with Scenario("user with revoked privilege"):
        view_name = f"view_{getuid()}"
        try:
            with Given("I have a view"):
                node.query(f"CREATE VIEW {view_name} AS SELECT 1")
            with When("I grant the drop view privilege"):
                node.query(f"GRANT DROP VIEW ON {view_name} TO {grant_target_name}")
            with And("I revoke the drop view privilege"):
                node.query(f"REVOKE DROP VIEW ON {view_name} FROM {grant_target_name}")
            with Then("I attempt to drop a  view"):
                node.query(f"DETACH VIEW {view_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I reattach the view as a table", flags=TE):
                node.query(f"ATTACH VIEW IF NOT EXISTS {view_name} AS SELECT 1")
            with And("I drop the view", flags=TE):
                node.query(f"DROP VIEW IF EXISTS {view_name}")
    with Scenario("user with revoked ALL privilege"):
        view_name = f"view_{getuid()}"
        try:
            with Given("I have a view"):
                node.query(f"CREATE VIEW {view_name} AS SELECT 1")
            with When("I grant the drop view privilege"):
                node.query(f"GRANT DROP VIEW ON {view_name} 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 drop a  view"):
                node.query(f"DETACH VIEW {view_name}", settings = [("user", user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I reattach the view as a table", flags=TE):
                node.query(f"ATTACH VIEW IF NOT EXISTS {view_name} AS SELECT 1")
            with And("I drop the view", flags=TE):
                node.query(f"DROP VIEW IF EXISTS {view_name}")
    with Scenario("user with ALL privilege"):
        view_name = f"view_{getuid()}"
        try:
            with Given("I have a view"):
                node.query(f"CREATE VIEW {view_name} AS SELECT 1")
            with When("I grant ALL privilege"):
                node.query(f"GRANT ALL ON *.* TO {grant_target_name}")
            with Then("I attempt to drop a view"):
                node.query(f"DETACH VIEW {view_name}", settings = [("user", user_name)])
        finally:
            with Finally("I reattach the view as a table", flags=TE):
                node.query(f"ATTACH VIEW IF NOT EXISTS {view_name} AS SELECT 1")
            with And("I drop the table", flags=TE):
                node.query(f"DROP VIEW IF EXISTS {view_name}")