Reliance Insurance Company (Reliance), having provided performance and payment bonds to EJ. Sciaba Contracting Co., Inc. (Sciaba), a general contractor, in connection with a project of the department of neighborhood development of the city of Boston (city), paid Sciaba’s debt to CJM Services, Inc. (CJM), a subcontractor.4 Reliance, as subrogee of Sciaba, sought to recover the payment from the city. The city in turn asserted third-party claims against the remaining parties. Acting on a motion to dismiss pursuant to Mass.R.Civ.P. 12(b)(6), 365 Mass. 754 (1974), filed by the city and the other third-party defendants, a judge of the Superior Court dismissed two counts of Reliance’s action on the grounds that (1) an anti-assignment clause in the construction contract entered into by the city and Sciaba precluded Reliance, as Sciaba’s surety, from asserting subrogation claims against the city; and (2) the failure of CJM to file a timely proof of claim in Sciaba’s bankruptcy proceeding rendered it impossible for CJM to collect against Sciaba, thus eliminating Reliance’s subrogation claim. Following the judge’s decision on the motion, separate and final judgment entered pursuant to Mass.R.Civ.P. 54(b), 365 Mass. 820 (1974).
Contrary to the motion judge, we conclude that (1) the anti-assignment clause was not intended to eliminate subrogation rights otherwise enjoyed by a surety;-and (2) once Reliance paid CJM, CJM’s ability to recover in bankruptcy against Sciaba became irrelevant to Reliance’s right as subrogee to pursue Sciaba’s claim against the city. Accordingly, we reverse the judgment and direct that the counts in question be restored for further proceedings.
1. Background. The underlying facts and procedural history are not disputed. Engaged in a project to renovate the Vine Street Community Center on Dudley Street in Boston (Vine Street center), the city in late 1998 selected Sciaba to be the general contractor. On January 4, 1999, Sciaba obtained both *552performance and payment bonds from Reliance as required by G. L. c. 149, § 29. The city and Sciaba executed the contract on January 26,1999. On July 21,1999, Sciaba and Reliance executed a continuing agreement of indemnity, effective November 4, 1998, whereby Sciaba agreed “[t]o assign, transfer and convey [to Reliance] ... as collateral security for the full performance of the covenants and agreements herein contained . . . [a]ll rights, actions, causes of action, claims and demands of [Sciaba] in, or arising from or out of” the general contract entered into between Sciaba and the city.
However, the general contract contains three provisions that limit the right of Sciaba to assign rights or obligations under the contract. In the standard general conditions, art. 10.1 provides that “[t]he Contractor (Sciaba) shall not assign, delegate, subcontract or in any way transfer any interest in this Contract without prior written consent of the Official.”5 Elsewhere in the contract, among its miscellaneous terms, it is provided in art. 7.16 that “[n]o assignment by a party to this Contract of any rights under or interests in the Contract Documents will be binding on the other party without the written consent of the party sought to be bound; and specifically, but without limitation, monies that may become due and monies that are due may not be assigned without such consent . . . .” The restriction is reiterated in article 7.12: “The Contractor shall not sell, assign, transfer or otherwise convey any of his rights and shall not delegate any of his duties under this Agreement without the prior and express written consent of the City and the Surety. In its sole discretion the City may refuse to consent to any proposed assignment or delegation.”
On February 2, 1999, Sciaba subcontracted with CJM for the performance of certain abatement services for the project. These *553services involved the removal and disposal of asbestos, lead, avian fecal matter, and contaminated soil from the Vine Street center at which the contemplated renovations would take place. Relying on specifications and plan documents created by the city, ICON, Pratt, and the joint venture, CJM agreed to perform the required services for a lump sum payment of $80,000. Prior to commencing the work, however, CJM and Sciaba conducted a visual inspection of the site and found far greater deterioration than originally contemplated in the design documents.
CJM and Sciaba informed the city of their findings, emphasizing that increased funds would be required for proper amelioration of the site’s condition. While initially reluctant to increase its expenditures, the city eventually authorized payment for the increased work on a time and materials basis. Ultimately, the total cost for abatement services reached $1,518,154.25. The city refused to pay Sciaba a substantial portion of this amount, and Sciaba in turn refused to pay CJM a total of $770,532.74 for the work in question.
CJM then initiated what evolved into this proceeding by filing a complaint under G. L. c. 149, § 29, in Superior Court against both Sciaba and Reliance seeking recovery under the payment bond. See note 4, supra. Sciaba thereafter filed a third-party complaint against the city asserting claims for breach of contract, contribution, and indemnification arising out of the city’s alleged fault in underestimating the scope of required abatement services and then in failing to pay Sciaba for the expanded services of its subcontractor. The city in turn filed what it denominated its own third-party complaint claiming that any liability to Sciaba that it might have incurred was caused by the negligent preparation of design documents by ICON, Pratt, and the joint venture.
On December 18, 2003, Sciaba filed a bankruptcy petition under chapter 7 of the Bankruptcy Code, see 11 U.S.C. § 301 (2000). CJM did not file a proof of claim by the deadline, instead seeking and obtaining leave from a bankruptcy judge to proceed solely against Reliance.7 On October 8, 2004, the city, ICON, Pratt, and the joint venture filed a motion to dismiss *554Sciaba’s third-party complaint.8 Reliance opposed the motion in its capacity as Sciaba’s surety. As indicated, a judge dismissed the counts of Sciaba’s third-party complaint that claimed rights of contribution and indemnification by the city, but denied the motion with respect to Sciaba’s breach of contract claim. Reliance voluntarily dismissed that claim, thereby rendering the dismissal of the remaining counts ripe for appeal.
In November, 2005, Reliance paid CJM the full amount of CJM’s claim against Sciaba.9 This appeal now turns on whether Reliance is entitled to recover on Sciaba’s claim against the city notwithstanding the anti-assignment provisions of the general contract and the failure of CJM to file a timely proof of claim in the Sciaba bankruptcy.
2. The motion to dismiss. While the joint motion to dismiss Sciaba’s third-party complaint, and thereby also eliminate Reliance’s right of recovery, was filed pursuant to Mass.R.Civ.R 12(b)(6), the third-party defendants nevertheless attached to their motion copies of a bankruptcy court docket sheet and an affidavit of CJM’s counsel establishing that CJM had in fact filed no proof of claim in the Sciaba bankruptcy. Without objection by Reliance, the judge considered those documents in connection with the motion to dismiss and relied on their accuracy in concluding that CJM had waived any rights against Sciaba that it might have had in the bankruptcy proceeding.10
The parties go to considerable lengths to attack or defend the judge’s use of materials extrinsic to the complaint in arriving at that portion of the decision wherein he concluded that Sciaba was immune from a judgment and that consequently Reliance as its surety had nothing to which it could be subrogated. Reliance, albeit belatedly, argues that motions under rule 12(b)(6) are reserved for those cases where, confining the inquiry to the *555four comers of the complaint, a defendant can establish that “it appears beyond doubt that the plaintiff can prove no set of facts in support of his claim which would entitle him to relief.” Nader v. Citron, 372 Mass. 96, 98 (1977), quoting from Conley v. Gibson, 355 U.S. 41, 45-46 (1957). In arriving at such a determination, the judge must take as true the allegations of the complaint, with all permissible inferences in the plaintiff’s favor. See Parker v. Chief Justice for Admn. & Mgmt. of the Trial Ct., 67 Mass. App. Ct. 174, 176 (2006). “Doubt as to whether a particular claim is provable is not a proper basis to dismiss a plaintiff’s complaint under rule 12(b)(6).” Gibbs Ford, Inc. v. United Truck Leasing Corp., 399 Mass. 8, 13 (1987). A judge is free to consider matters outside of the pleading on a motion to dismiss, but in such instance “the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56, and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by Rule 56.” Mass.R.Civ.P. 12(b), 365 Mass. 754 (1974). Where the failure to provide such an opportunity results in prejudice to a party, such a failure can constitute reversible error. See White v. Peabody Constr. Co., 386 Mass. 121, 127 (1982).
On the other hand, while the allegations of the complaint generally control in evaluating a motion under rule 12(b)(6), “matters of public record, orders, items appearing in the record of the case, and exhibits attached to the complaint, also may be taken into account.” Schaer v. Brandeis Univ., 432 Mass. 474, All (2000), quoting from 5A Wright & Miller, Federal Practice and Procedure § 1357, at 299 (1990). Properly considered public records include the records of other courts in related proceedings, of which the judge may take judicial notice in any event. See Brookline v. Goldstein, 388 Mass. 443, 447 (1983); Jarosz v. Palmer, 436 Mass. 526, 530 (2002); Brodin & Avery, Massachusetts Evidence § 2.8.1, at 46 (8th ed. 2007).
Here, the fact at issue, i.e., that CJM did not file a timely proof of claim in Sciaba’s bankruptcy proceeding, is established by the docket of the Bankruptcy Court. That is a public record of which the judge was entitled to take notice, particularly absent any genuine contention that the docket was inaccurate. The attorney’s affidavit to the effect that CJM did not file a *556timely proof of claim does no more than reflect the court docket in this respect and is superfluous. Thus, we do not understand in what way Reliance was prejudiced by the judge’s consideration of an apparently undisputed fact without converting the motion to one for summary judgment. See White v. Peabody Constr. Co., supra; Jarosz v. Palmer, supra. Reliance’s argument below that CJM could still file a motion for leave to submit a late proof of claim indicates that it was not surprised by the contention. We conclude that there was no error in the judge’s consideration of an undisputed fact of record and, even had there been error, it was harmless.11
3. The anti-assignment clause. The city urges, in keeping with the determination of the motion judge, that the various anti-assignment provisions in the general contract operate to preclude claims by Reliance against the city, including claims it might assert on a theory of equitable subrogation. Read literally, the provisions appear to support the city’s position. Article 10.1 of the general conditions prohibits, absent prior consent, the transfer by the contractor of “any interest” in the contract. Article 7.1 of a section labeled “miscellaneous” precludes, without prior written consent, the assignment of “any rights under or interest in” the contract, and expressly includes “monies that may become due and monies that are due.” Likewise, art. 7.12 of the miscellaneous provisions forbids, again absent prior written consent, the transfer of any of the contractor’s rights or the delegation of any of its duties.
Given the breadth of the contractual language, we are not persuaded by Reliance’s argument that the city’s purpose was limited to preventing the delegation of performance. While the city understandably would resist having the work entrusted to entities other than the one selected as general contractor, the language employed goes considerably further, covering “any interest,” “any rights,” and monies that are or may be due. Thus the language of the anti-assignment clauses does embrace claims for payment under the contract, including Sciaba’s claim that the city was obligated to pay it for the extra remediation work performed by CJM.
*557In our view, however, the analysis does not end there. The question remains whether the general contract’s prohibition against transfers of rights and obligations, characterized variously as assignments, sales, conveyances, delegations or transfers, was intended to apply to the subrogation rights of a surety arising from payment by that surety of an obligation of the general contractor. We conclude that it was not so intended.
The parties have not pointed us to cases in the Commonwealth that have adjudicated the question directly. Reliance refers us to Handex of Md., Inc. v. Waste Mgmt. Disposal Servs. of Md., Inc., 458 F. Supp. 2d 266, 273 (D. Md. 2006), wherein the court confronted the relationship between an anti-assignment clause in a general contract between an owner and contractor and an assignment clause in an .indemnity agreement between the contractor and a surety. Id. at 268. There, the judge reasoned that, given the owner’s awareness from the beginning of the surety’s involvement, as well as of routine practices in the construction industry, “a reasonable person in the position of the parties to this three-way relationship would understand the nonassignment clause to be inapplicable to [the insurer] as [the contractor’s] surety.” Id. at 273. We believe that that analysis is sound and is particularly applicable where, as in the present case, the surety-ship arrangement is required by statute.12
The practice of demanding performance and payment bonds in connection with construction contracts is not unknown by the sponsors of significant construction projects, and particularly by government entities. The acquisition of what is essentially insurance provides an additional level of confidence that the project will in fact be completed and that amounts owed to subcontractors, vendors, and others will ultimately be paid. With respect to most public construction projects in the Commonwealth, the posting of payment and performance bonds is required by statute. See G. L. c. 149, §§ 29, 44E. Obviously, the city was aware that a payment bond was in place in connection with the renovations of the Vine Street center; indeed, it could not lawfully have contracted for construction with respect to the project had its contractor (Sciaba) not obtained such protection.
*558This being the case, the city presumably was on notice that ordinary practices and expectations would apply with regard to the surety agreement. Those include the normal sequence that the surety, having made payment on behalf of its principal, acquires the rights of that principal against third parties, including the owner, so that it can offset its loss to the extent possible. Few doctrines are “better established than that a surety who pays the debt of another is entitled to all the rights of the person he paid to enforce his right to be reimbursed.” Pearlman v. Reliance Ins. Co., 371 U.S. 132, 136-137 (1962). “Rights of subrogation, although growing out of a contractual setting and ofttimes articulated by the contract, do not depend for their existence on a grant in the contract, but are created by law to avoid injustice.” Canter v. Schlager, 358 Mass. 789, 792 (1971).
We leave for another day the interesting question whether an effective contractual bar against subrogation in a public construction context might, in light of the statute requiring the provision of surety bonds, be unenforceable as violative of public policy. Suffice it to say that in the present case, as in Handex, the parties knew full well that the surety would seek to recoup any losses by exercising its right of subrogation (which it obtained both contractually through the indemnity agreement with the contractor and as a matter of equity). It follows that the anti-assignment clauses in the general contract cannot reasonably be construed to affect subrogation rights under the payment bond. The anti-assignment clauses have their full force and effect in preventing the general contractor from impermissibly delegating aspects of the work; prohibiting the assignment of claims so that the owner is required to deal with third parties; and eliminating transfers of rights and duties of a similar nature that would embroil the owner in the necessity of conducting business with individuals or entities not of its own choosing. We do not interpret the clauses as intending to deny normal subrogation rights and assume, were that the parties’ intention, that there would have been express references to subrogation as prohibited.13
We do not base our conclusion on the provisions of G. L. *559c. 106, § 2-210(3), or on the Restatement (Second) of Contracts § 322 (1981), despite Reliance’s arguments thereon. General Laws c. 106, § 2-210(3), which provides that prohibitions of assignment with respect to contracts will ordinarily prohibit only the delegation of performance of the contracts, is a provision of art. 2 of the Uniform Commercial Code and applies to sales of goods. See G. L. c. 106, § 2-102. In addition, both that statute and the Restatement section on which Reliance relies limit the scope of the anti-assignment clauses “[u]nless the circumstances indicate the contrary.” The city can argue in this regard that the breadth of language in the anti-assignment provisions of the general contract constitutes a circumstance indicating that the clauses were not to be given the narrow scope invited by the Code and the Restatement.
Nor do we place weight on the proposition that, because the contract has been performed, the anti-assignment provisions are no longer operative. Such a construction is possible, but it is certainly not an unavoidable interpretation of the contract. Neither do we hold that an insurer providing a performance or payment bond can never voluntarily waive its equitable right of subrogation. We conclude on this record only that the parties in the circumstances of the present case did not intend the anti-assignment provisions to interfere with normal subrogation rights.14
4. The bankruptcy proceeding. The city asserts that Sciaba’s bankruptcy proceeding has effectively eliminated Reliance’s contribution and indemnification claims. As we understand the argument, it is that CJM failed to file a timely proof of its claim that Sciaba had not paid amounts due for extra remediation *560work; as a result, any debt of Sciaba to CJM would be discharged and Sciaba would owe CJM nothing; because Sciaba owed and would pay nothing, there was no obligation to which the city was required to contribute or which it was required to indemnify; and, to the extent Reliance is subrogated to the rights of Sciaba, it is subrogated to rights of no value.
The city’s argument seems to us to depend upon Reliance’s relationship with CJM that was created when Reliance participated in a payment in full of CJM’s claim against Sciaba, thereby succeeding to CJM’s rights against the general contractor. If that were the entire picture, the argument might have merit because, as a result of the bankruptcy, Reliance would be in no better position to collect against Sciaba than CJM would be after it failed to file a proof of claim. But it is not subrogation to CJM’s claim against Sciaba on which Reliance relies; rather, it is Sciaba’s claim against the city to which Reliance is subrogated both equitably and by express assignment (see part 3, supra).
When Reliance agreed to provide Sciaba with a payment bond, it entered into a contract with Sciaba that created rights in various third-party beneficiaries, including CJM. It is, after all, the point of a payment bond that creditors such as CJM will be paid notwithstanding that their debtors such as Sciaba are unable or unwilling to fulfil their obligations. Thus, Reliance did not pay Sciaba’s debt to CJM as a volunteer; it paid because it was contractually obligated to do so, thereby succeeding to whatever claims Sciaba may in turn have had against others. That being the case, the Sciaba bankruptcy is essentially irrelevant. See, e.g., In re Shondel, 950 F.2d 1301, 1306-1307 (7th Cir. 1991). CJM may have been barred from seeking recovery against Sciaba15; Reliance is not barred from asserting a claim for reimbursement by the city.
5. Conclusion. We see no reason of public policy, including *561the policies that underlie bankruptcy proceedings, why Reliance should not be permitted to pursue this claim. The city was required by statute to award the job to a contractor that could obtain a payment bond. Reliance provided the bond and paid in good faith a subcontractor’s claim thereunder. It is entitled to proceed against the city in an effort to obtain reimbursement.
Judgment reversed.
The case before us began with a complaint filed by CJM, pursuant to G. L. c. 149, § 29, against both Sciaba and Reliance, as will be discussed infra. CJM’s claim was paid and is not before us.
“The Official” refers to the awarding authority or officer acting on behalf of the city in the execution of the contract. Article 10.1 thus effectively vests in the city the right to prevent the kinds of assignments governed by the clause.
Reliance disputes the consideration on appeal of arts. 7.1 and 7.12 on the ground that the city did not rely on such provisions in supporting its motion to dismiss in the Superior Court. The articles are a part of the contract that is at the heart of the case. In any event, given our disposition of the appeal, Reliance will not be affected adversely by consideration of those provisions.
By a motion filed in the Superior Court on September 15, 2004, Reliance requested that it be substituted for Sciaba so that CJM’s claim could proceed *554solely against it (Reliance), but the motion was denied.
In the motion to dismiss, the city acknowledged that, in the event it prevailed on the motion, its claims against the remaining third-party defendants could also be dismissed.
Pursuant to certain indemnification obligations, J.F. White Contracting Co., Inc., paid a portion of the amount. Its participation is not at issue in this appeal.
Reliance first raised the issue regarding the judge’s use of materials outside the complaint in a motion for reconsideration which was denied.
This is particularly so given that Reliance prevails on the merits even after consideration of the extrinsic information.
In the Handex case, only private parties were involved, and while surety-ship arrangements were customary in the industry, there was no statutory requirement that bonds be obtained.
We agree in this regard with the observation at oral argument that, were the city’s interpretation of the anti-assignment clauses to prevail, the municipality could well find itself unable to go forward with public construction projects *559of any size because contractors would find it difficult, if not impossible, to obtain the statutorily required surety bonds.
We acknowledge the city’s citation to Globe Indem. Co. v. West Tex. Lumber Co., 34 S.W.2d 896, 899 (Tex. 1930), wherein it was held that a contractual clause prohibiting assignment “of any interest” precluded subrogation of a surety. There, a surety bond issued to protect laborers and materialmen on a private project was accompanied by an assignment by the contractor of amounts due under the contract effective only upon the contractor’s breach. The owner had no knowledge of the assignment, and the contractor never breached. The court held that, in the circumstances, the assignment never became absolute. Id. at 898. The different facts of the present case render the decision inapplicable.
It follows that we do not rely on Reliance’s contention that CJM could have revived its claim against Sciaba by moving for leave to file a late proof of claim in the bankruptcy proceeding. It is unlikely in any event that such a motion, which requires proof of excusable neglect, would have been allowed. See Fed.R.Bankr.P. 9006(b)(1); In re Aboody, 223 B.R. 36, 37 (B.A.P. 1st Cir. 1998). The consideration is irrelevant because, as we have indicated, it is not CJM’s claim against Sciaba that Reliance asserts.