To hide the power-off menu in Ubuntu with GNOME desktop, you can use the "Bring Out Submenu Of Power Off Button" extension in the Extension Manager.
To add password request for power-off and reboot actions, you can use the built-in polkit tool by creating custom polkit configuration files.
For Ubuntu 22.04 and earlier, you can create a rule in the "com.ubuntu.enable-hibernate.pkla" file in the "/etc/polkit-1/localauthority/50-local.d/" directory.