(2)The regulations to be made under this section may apply to naval prisons or detention quarters any of the provisions of the Prisons Act, 1894 (9 of 1874), and rules made thereunder, imposing punishments on any persons not being prisoners or relating to the duties of gaolers, medical officers and other officers of the prisons.