Section 232(1) in The Naval Ceremonial, Conditions Of Service And Miscellaneous Regulations, 1964
(1)If the Captain has ceased to exercise command whether through sickness or for any other reason, or because of absence on duty, or leave during which he will be away from the ship, the officer next in command shall assume powers and duties as though he had himself been appointed in command. In such circumstances he has full powers of punishment as Captain of the ship.