def METHOD_NAME(self, privilege, grant_target_name, user_name, node=None):
    """Check that user is only able to execute `CREATE QUOTA` when they have the necessary privilege.
    """
    exitcode, message = errors.not_enough_privileges(name=user_name)
    if node is None:
        node = self.context.node
    with Scenario("CREATE QUOTA without privilege"):
        create_quota_name = f"create_quota_{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 check the user can't create a quota"):
                node.query(f"CREATE QUOTA {create_quota_name}", settings=[("user",user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I drop the quota"):
                node.query(f"DROP QUOTA IF EXISTS {create_quota_name}")
    with Scenario("CREATE QUOTA with privilege"):
        create_quota_name = f"create_quota_{getuid()}"
        try:
            with When(f"I grant {privilege}"):
                node.query(f"GRANT {privilege} ON *.* TO {grant_target_name}")
            with Then("I check the user can create a quota"):
                node.query(f"CREATE QUOTA {create_quota_name}", settings = [("user", f"{user_name}")])
        finally:
            with Finally("I drop the quota"):
                node.query(f"DROP QUOTA IF EXISTS {create_quota_name}")
    with Scenario("CREATE QUOTA on cluster"):
        create_quota_name = f"create_quota_{getuid()}"
        try:
            with When(f"I grant {privilege}"):
                node.query(f"GRANT {privilege} ON *.* TO {grant_target_name}")
            with Then("I check the user can create a quota"):
                node.query(f"CREATE QUOTA {create_quota_name} ON CLUSTER sharded_cluster", settings = [("user", f"{user_name}")])
        finally:
            with Finally("I drop the quota"):
                node.query(f"DROP QUOTA IF EXISTS {create_quota_name} ON CLUSTER sharded_cluster")
    with Scenario("CREATE QUOTA with revoked privilege"):
        create_quota_name = f"create_quota_{getuid()}"
        try:
            with When(f"I grant {privilege}"):
                node.query(f"GRANT {privilege} ON *.* TO {grant_target_name}")
            with And(f"I revoke {privilege}"):
                node.query(f"REVOKE {privilege} ON *.* FROM {grant_target_name}")
            with Then("I check the user cannot create a quota"):
                node.query(f"CREATE QUOTA {create_quota_name}", settings=[("user",user_name)],
                    exitcode=exitcode, message=message)
        finally:
            with Finally("I drop the quota"):
                node.query(f"DROP QUOTA IF EXISTS {create_quota_name}")