The question for decision is whether mandamus will lie to require the issuance of a building permit in violation of an ordinance. The answer is “No.” Braddy v. Winston-Salem, 201 N. C., 301, 159 S. E., 310; Refining Co. v. McKernan, 179 N. C., 314, 102 S. E., 505.
In the instant case, it is enough to say the writ should have been denied, or limited to a lawful permit, for want of a clear showing of right on the part of the applicant to demand it. Hayes v. Benton, 193 N. C., 379, 137 S. E., 169. Mandamus lies only to enforce a clear legal right. Cody v. Barrett, 200 N. C., 43, 156 S. E., 146.
The admission by applicant that “its proposed method of unloading gas . . . will be in direct violation of the city ordinance” defeats its right to the peremptory mandamus which it here seeks, albeit its right to a permit to construct and operate a lawful filling station is neither denied nor resisted by the respondents. Mandamus lies only to compel a party to do that which it is his duty to do without it. It confers no new authority. The party seeking the writ must have a clear legal right to demand it, and the party to be coerced must be under a legal obligation to perform the act sought to be enforced. Person v. Doughton, 186 N. C., 723, 120 S. E., 481; Missouri v. Murphy, 170 U. S., 78.
The power to enact regulatory ordinances for the safety and protection of the public is not to be forestalled or foreclosed by specific writs of mandamus. Wake Forest v. Medlin, 199 N. C., 83, 154 S. E., 29.
Error and remanded.