
537 So.2d 7 (1988)
Lorenzo GRANT and Wood Gaston, Jr.
v.
Patricia DAVIS; and Tina Ingersoll, a minor, By and Through her father and next friend, Edward Ingersoll.
86-436.
Supreme Court of Alabama.
November 23, 1988.
Jack F. Norton, Chief Counsel, and Jerry L. Weidler, Asst. Counsel, Alabama Highway Dept., Montgomery, for appellants.
Truman M. Hobbs, Jr., of Copeland, Franco, Screws & Gill, Montgomery, for appellees.
BEATTY, Justice.
This is an appeal from the trial court's denial of defendants' motion for JNOV or, in the alternative, for a new trial in an action for personal injuries suffered in an automobile accident caused by a defect in the road.
On December 10, 1984, Patricia Rogers Davis and her sister, Tina Ingersoll were traveling south on Highway 49 a few miles south of Dadeville. The right rear tire of the Chevrolet van in which they were riding slid off the road into a rut or drop-off. Davis attempted to guide the van back onto the road, but she lost control of the vehicle, causing it to flip. Davis and Ingersoll suffered personal injuries and the van was damaged beyond repair. They brought an action against certain individual supervisory employees of the State Highway Department ("the Department"), asserting that they were negligent and reckless or wanton in failing to properly inspect, maintain, or repair the shoulder of the road.
Defendants moved for summary judgment on the grounds that they were immune from suit under the doctrine of sovereign immunity and the attendant governmental function immunity because, they claimed, all of the alleged acts or omissions by the defendants were done in good faith and in the performance of their discretionary administrative functions. The trial court entered summary judgment in favor of three named defendants but denied the motion as to appellants Lorenzo H. Grant and Wood Gaston. The parties proceeded to trial on the claims against these defendants.
Lorenzo H. Grant is the District I engineer responsible for all construction and *8 maintenance activities within his district. It is his job to ride the roads and, along with his superintendent, Wood Gaston, to determine what repairs or construction is needed. According to Gaston, who is the District I superintendent, he also inspects all the roads at least once a month. He and Grant share 37 maintenance activities. When a need for repair is determined, Grant and Gaston rank or prioritize the repair projects according to a number of factors including the type of defect, the particular road in question, and the economic resources and manpower available for allocation by them.
Gaston testified that in late November 1984 he drove down Highway 49, including the stretch where Davis was injured, inspecting the roadway. Gaston determined that some routine maintenance was needed along Highway 49 and sent a crew to start working. Gaston stated that, at that time, he did spot certain potholes and ruts on the shoulder on Highway 49 in isolated places. However, he did not discover any ruts or drop-offs in the entire stretch of the curve where Davis later had her accident.
The case was submitted to the jury, which returned separate verdicts for the plaintiffs. Judgment was entered on the verdict for plaintiff Davis for $16,000 and on the verdict for plaintiff Ingersoll, who sued through her father and next friend, Edward Ingersoll, for $2,500. The court denied the defendants' motion for JNOV or, in the alternative, for a new trial. The defendants appeal, asserting that they are entitled to discretionary function immunity and, therefore, as a matter of law, are not liable for the injuries suffered by the plaintiffs. Thus, the defendants argue that they were entitled to JNOV based upon the immunity defense as to all counts in the complaint. We agree.
Discretionary function immunity is just what its label implies: immunity from tort liability afforded to public officials acting within the general scope of their authority in performing functions that involve a degree of discretion. See, DeStafney v. University of Alabama, 413 So.2d 391 (Ala.1981), adopting Restatement (Second) of Torts, § 895D, "Public Officers" (1974). The applicability of the doctrine of qualified immunity must be determined on a case-by-case basis. Under this Court's decision in Barnes v. Dale, 530 So.2d 770 (Ala.1988), whether a particular defendant is engaged in a protected discretionary function, and is thereby immune from liability for injuries he causes, is a question of law to be decided by the trial court.
In Bell v. Chisom, 421 So.2d 1239, 1241 (Ala.1982), this Court discussed at length the elements of, and factors for determining, the applicability of discretionary function immunity in a given case:
"As the Restatement's comments suggest, the courts have at times found the discretionary function standard difficult to interpret. Nevertheless, in many cases this standard's proper application will be readily apparent. Two such cases will serve to illustrate the conflicting policy considerations the courts must apply. On the one hand, in DeStafney itself we had no difficulty in rejecting the immunity claim of the individual defendant, an aide at the University day care center who allegedly allowed the plaintiff's child to fall off playground equipment. This defendant's function clearly required due care rather than difficult decision making. On the other hand, we accepted the claim of immunity in Gill v. Sewell, Ala., 356 So.2d 1196 (1978), where the director of a work release center was sued for his decision to release a convicted felon who shot the plaintiff. That decision was an exercise of discretion central to the defendant's function, and accordingly in DeStafney we noted, `unquestionably, Gill falls squarely within § 895D(3)(a) of the Restatement,' 413 So.2d at 394.
"These two cases illustrate the governmental interest at stake in discretionary function immunity: the ability of public officers to `engage in making a decision by weighing the policies for and against it.' Restatement, supra, comment d at 413. Without some degree of immunity, public officers may decide not on the basis of policy but of avoiding personal liability or vexatious suits. Their motive *9 for doing so may be larger than in the private sector, for governmental action often has unusual potential to injure or to affect large numbers of people. See G. Bermann, `Integrating Governmental and Officer Tort Liability,' 77 Columbia L.Rev. 1175, 1177 (1977). Discretionary function immunity, then, is called for when necessary to preserve the decision making function of government.
"Considerable precedent has developed applying the concept of discretionary function in various contexts. The most common approach to the problem is to distinguish between planning and operational levels of action, with only the former being immune. Such terms, however, are only shorthand for a range of factorsdiscussed in the Restatement commentsthat the courts may need to consider. The problem is not to define terms like `discretionary' or `planning' but to make a pragmatic assessment of what, if any, degree of immunity is necessary to enable the particular governmental function to be effectively performed. Thus, courts must determine not only the existence but the extent of an `immunity,' which may be absolute but is more commonly limited to good faith actions. See comments e and f from the Restatement."

The evidence adduced at trial established that once the defendants determine that repairs are needed, they share the responsibility of ranking the various projects, based on factors that include the ones enumerated above, viz., the type of defect, the particular road in question, and the economic resources and manpower available. While the defendants' duty to maintain and repair the roads is an affirmative duty, they must exercise a degree of discretion in the process of ranking various projects by priority. Ideally, the slightest defect would be repaired immediately so that the highways would, at all times, be maintained at the greatest level of safety. Reality, however, poses limitations on the time, manpower, and financial resources available for making the needed repairs. It is under these limitations that the defendants must assess the relative priority to be given the various defects that are discovered, and rank their repair so as to achieve the optimum level of safety possible under all circumstances. While the Department's "Field Operations Manual" provides criteria by which these decisions are to be made, in the final analysis a significant degree of discretion is left to the defendants in their exercise of this particular function. We find that the appellants' duties associated with the repair and maintenance function substantially partake of planning level activities involving the exercise of discretion, and the defendants are therefore entitled to substantive immunity as a matter of law on plaintiffs' claims for failure to maintain and repair. Thus, the defendants' motion for JNOV should have been granted as to those claims.
We also find that the same is true with respect to the claim that the defendants were negligent in failing to properly inspect the shoulder of the road and discover the defect. Both the "Maintenance Manual" and the "Field Operations Manual," publications adopted to guide the Department workers in the performance of their duties, mandate frequent inspection of the roads to discover defects. The "Field Operations Manual" provides: "To make effective decisions, the Superintendent must be aware at all times of the current conditions of the roads. This means frequent inspection is necessary. Periodic inspection by the Superintendent and District Engineer will reveal additional locations where maintenance work is needed." In addressing management responsibilities, the "Field Operations Manual" provides that the responsibilities of the division engineer and the division maintenance engineer include conducting formal semi-annual road inspections with each district engineer. The superintendent is further instructed to conduct weekly inspections of the road systems for the purpose of identifying specific maintenance required to provide the desired levels of maintenance service. The maintenance manual provides that "maintenance personnel, particularly field supervisors, must constantly be aware of the condition of the highways that they are responsible *10 for, and also be able to readily identify specific sections and roadway features that require maintenance attention."
The duty to inspect the roads is an affirmative duty but one that also involves a type of discretion giving rise to qualified immunity. In performing that function, the defendants are involved in determining the manner of carrying out these inspections, i.e., determining the method and means. Thus, they are carrying out the directives of the guidelines that they must follow by determining how the inspections are to be carried out. While the defendants have no discretion not to inspect, they do have the discretion to determine the practical method for inspecting each road. We find this conclusion consistent with the guidelines established in comment f of § 895D of the Restatement, and with our decisions in DeStafney and Chisom, supra.
Discretionary function immunity having been recognized for these defendants, it follows that the trial court erred in denying the motion for JNOV as it pertained to the charge of negligence in failing to properly inspect the roads. For that error the judgment must be reversed and the cause remanded for an order consistent with this opinion. It is so ordered.
REVERSED AND REMANDED.
All the Justices concur.
