
447 So.2d 717 (1984)
Ex parte MID-CONTINENT SYSTEMS, INC., and D.G. Seago, Jr.
(In re V-J CORPORATION,
v.
BESSEMER OIL COMPANY, INC.; William T. Allen; Mid-Continent Systems, Inc., D.G. Seago, Jr., et al.)
83-156.
Supreme Court of Alabama.
March 2, 1984.
Robert H. Loeb and Thomas M. Ray of Gordon, Silberman, Loeb, Cleveland & Gordon, Birmingham, for petitioners.
Richard F. Ogle and Douglas J. Centeno of Denaburg, Schoel, Meyerson, Ogle, Zarzaur & Max, Birmingham, and Arthur Green of Paden, Green & Paden, Bessemer, for respondents.
EMBRY, Justice.
This is an original petition for the writ of mandamus seeking to require the Honorable Walter G. Bridges, Judge of the Circuit Court of Jefferson County, Bessemer Division, to set aside an order requiring production of records for examination by a court appointed auditor. The records are those of Mid-Continent Systems, Inc., of which D.G. Seago, Jr., is chief executive officer and chairman of its board of directors.
The action giving rise to this petition was brought by V-J Corporation against Mid-Continent *718 and Seago, among others, seeking money damages on an open account, for worthless checks, and under the legal theories of: unjust enrichment, corporate alter egoinstrumentality theory, conspiracy to defraud, fraud, fraudulent suppression of material facts, deceit, and tortious interference with business relationships.
V-J filed a motion for preliminary injunction and other relief which requested the trial court to
"[R]efer this cause to a special master for a determination of whether, and the amount thereof, of any conversion of the assets of Bessemer Oil Company, and/or usurpation of the customer base of Bessemer Oil Company exists."
In the course of a hearing on that motion, an agreement was reached by V-J Corporation, Mid-Continent Systems and Seago. That agreement contains the following provisions pertinent to this appeal:
"WHEREAS, the parties executing this agreement are desirous of entering this agreement, pendente lite, in lieu of further proceedings in the Motion for Preliminary Injunction, it is therefore agreed as follows by and between the parties to this agreement:
"1. The Circuit Court of Jefferson County, Bessemer Division, shall appoint an Auditor. Such Auditor shall have no power other than to gather information from the records of the various parties to this action, and other relevant records.
"2. Said Auditor will be chosen by V-J and Southeast and approved by Mid-Continent Systems (MCS) and D.G. Seago, Jr. (Seago), which approval will not be unreasonably withheld.
". . . .
"5. The work performed by the Auditor, pursuant to this Agreement, will be limited to transactions, directly or indirectly, between and among MCS, Seago, and Bessemer Oil Company (Bessemer Oil), V-J & Southeast.
"6. The information gathered by the Auditor shall not be used for any competitive advantage by any oil company, directly or indirectly, whether or not a party to this action.
"7. All parties to this Agreement shall have access to the Auditor and to his work papers. This access shall include the right to direct the attention of the Auditor to any information deemed relevant by any of the parties to this Agreement, including, but not limited to, the MCS letter dated 12/29/81 to creditors of Bessemer Oil."
The court proceeded to appoint, as auditor, a firm of certified public accountants that embarked upon the duties assigned them under the agreement. During the course of their examination of books and records of the parties litigant, the auditors determined there was a need to examine books and records of Mid-Continent at West Memphis, Arkansas. They went there to do so and learned of the existence of certain further records pertinent to their assigned task. After being denied the right to examine those records, they returned to Birmingham and reported this, after which V-J filed a motion to compel production and for sanctions. After an evidentiary hearing, the trial court ordered Mid-Continent and Seago to produce the documents. This original petition was then filed in this court for the writ of mandamus or prohibition.
Pertinent portions of the order complained of by Mid-Continent and Seago read:
"Therefore, the Defendants, Mid-Continent Systems, Inc. and D.G. Seago, Jr., are hereby ORDERED to produce for examination by the AUDITOR appointed by this Court on June 20, 1983, all documents requested by the AUDITOR in furtherance of its investigation. Without limitation, these Defendants are specifically ORDERED to produce for examination by the AUDITOR all records which relate to the pricing policies of Mid-Continent Systems, Inc., from January 1, 1981 to the present, for any and all customers of Mid-Continent Systems, Inc. during that period of time.

*719 "FURTHER, this Court hereby enters the following Protective Order insofar as it relates to any documents produced which relate to the pricing policies of Mid-Continent Systems, Inc. with its customers from January 1, 1981 to the present:
"1. Any such information gathered by the AUDITOR shall not be used for any competitive advantage by anyone, whether or not a party to this action.
"2. The AUDITOR shall not disclose the substance of any information gathered from those records to any persons other than counsel for the Plaintiff and the Defendants, Mid-Continent Systems, Inc. and D.G. Seago, Jr.
"3. Any counsel receiving any such information from the AUDITOR shall not discuss said information with any non-counsel, including parties, except as is reasonably necessary for the preparation of the trial of the issues in this cause. [Here appears a handwritten addendum to this paragraph.[1]]
"4. If any party has reason to believe that anyone is violating the Protective Order contained herein, any such party shall immediately report that fact to this Court for further action consistent with this ORDER."
Petitioners stated the issues to be:
"I. Based upon the agreement of the parties approved by the court on June 30, 1983, and the evidence presented at the hearing on October 11, was the order of the court appropriate?
"II. In issuing the order dated October 14, 1983, did the court err in its construction of the limits imposed by the order of the court dated June 20, 1983?"
Respondent states the issues as:
"I. Whether the trial court properly exercised its discretion in ordering MCS and Seago to produce MCS documents to the court appointed auditor.
"II. Whether MCS and Seago are adequately protected by the October 14, 1983 order.
"III. Assuming arguendo that the trial court abused its discretion, whether MCS/Seago suffered error without injury due to the discoverable nature of the documents in question."
The controlling principles of law under which this court will determine whether to issue the writ of mandamus are: (1) Absent a clear abuse of discretion we will not disturb the trial court's order requiring production of the documents. Ex parte Allstate Insurance Co., 401 So.2d 749 (Ala. 1981). We find no such abuse and will therefore deny the petition. (2) The writ of mandamus will not issue when the right sought to be enforced is doubtful. We find the right sought to be enforced more than doubtful. Ex parte Dorsey Trailers, Inc., 397 So.2d 98 (Ala.1981).
Petitioners' statement of the issues is somewhat misleading. Apparently they would have this court review this case confined within a very limited context of their construction of the agreement and without regard to the authority of the trial court under the law and appropriate procedural rules. Under the agreement itself, the only limitations placed upon the auditor are found in paragraphs one and five. The auditor's work, or investigation, is limited to transactions, directly or indirectly, between and among Mid-Continent, Seago, Bessemer Oil Company, V-J, and Southeast, and information gathering is confined to records of the various parties to this action, and other relevant records. The exhibits to the petition (which make the record in this kind of proceedings) demonstrate that the documents ordered produced were in the records of Mid-Continent and contained information relevant to transactions indirectly between and among these parties. They also constituted "other relevant records." The order of production was therefore well within the discretion of the trial court, as well as being within the *720 powers granted the auditor by the agreement. Additionally, paragraph seven of the agreement is an ample grant of power to the parties, and thus to the auditor, for the latter to examine the records ordered produced. From all of this, it is quite clear the trial court's production order is not overly broad and was appropriate.
Neither did the trial court err in its construction of the limits imposed by its order of production. That court was not confined to the agreement in its power to compel production of the records it ordered produced. Rule 53(a), A.R.C.P., provides that in any action pending the court may appoint a special master; the rule goes on to state: "As used in these rules the word `master' includes a referee, an auditor, and an examiner." Rule 53(c) states in part: "He may require the production before him of evidence upon all matters embraced in the reference, including the production of all books, papers, vouchers, documents and writings applicable thereto." See Pathe Laboratories, Inc. v. du Pont Film Manufacturing Corp., 3 F.R.D. 11 (S.D.N.Y. 1943).
Regarding petitioners' contention that the trial court unlawfully delegated its authority to the auditor, we recognize that a court may not delegate a judicial function. This the trial court did not do. Only when the trial court allows a master to resolve purely legal questions can it be said there is an unlawful delegation of judicial powers. See Reed v. Cleveland Board of Education, 607 F.2d 737 (6th Cir.1979). In this case the auditor was merely seeking factual information to be made a part of its report of investigation of the transactions, directly or indirectly, between the parties to this litigation. See Cruz v. Hauck, 515 F.2d 322 (5th Cir.1975). For further enlightment respecting the trial court's power to order a reference more broad than a stipulation of the parties without abusing its discretion, see Torres v. International General Electric, S.A., 303 F.2d 615 (1st Cir.1962).
The court having concluded that petitioners show no right to have the writ of mandamus issue, the writ is denied.
WRIT DENIED.
TORBERT, C.J., and FAULKNER, ALMON and ADAMS, JJ., concur.
NOTES
[1]  The words in handwriting are: "No person receiving any such information from any counsel shall disclose such information to any other person."
