polkit.addRule(function(action, subject) {
        if ( action.id == "org.freedesktop.consolekit.system.stop" ||
             action.id == "org.freedesktop.consolekit.system.restart" ||
             action.id == "org.freedesktop.login1.reboot" ||
             action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
             action.id == "org.freedesktop.login1.power-off" ||
             action.id == "org.freedesktop.login1.power-off-multiple-sessions" )
    {
        if ( subject.isInGroup("root") ) {
            return polkit.Result.YES;
        } else {
            return polkit.Result.NO;
        }
    }
});
