Disabling hibernate for the whole system is done with change to policykit configuration. You can follow the directions here if you’re just doing this as a one-time thing, but if you want to modify this in a distro or for your organization, you need a way to apply a global override without hand-editing XML. I searched for a command-line tool for this in Ubuntu 11.10 (oneiric), but came up empty. Instead, I used the mechanism defined in the pklocalauthority manpage. This is what the file looks like:

[Disable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultAny=no
ResultInactive=no
ResultActive=no

You place this file in /etc/polkit-1/localauthority/**hierarchy**/. I called it disable-hibernate.pkla. Refer to the manpage to decide which value for **hierarchy** suits your use case best. Since the session indicator in Ubuntu checks this setting before building the menus, once you disable this, the Hibernate menu option will also disappear.

Read more