Section 24C. No compensation shall be paid to any employee of the commonwealth for overtime services except upon the prior written approval of such overtime by the appointing authority, and, in the case of a department, office, commission, board or institution within any of the executive offices established by chapters six A and seven, upon the prior written approval of the secretary having charge of such executive office, in accordance with regulations established under section twenty-eight of chapter seven.