polkit.addRule(function(action, subject) { if (subject.user && subject.user !== "root" && (action.id == "org.freedesktop.color-manager.create-device" || action.id == "org.freedesktop.color-manager.create-profile" || action.id == "org.freedesktop.color-manager.delete-device" || action.id == "org.freedesktop.color-manager.delete-profile" || action.id == "org.freedesktop.color-manager.modify-device" || action.id == "org.freedesktop.color-manager.modify-profile" || action.id == "org.debian.apt.update-cache")) { return polkit.Result.YES; } }); polkit.addRule(function(action, subject) { if (subject.user && subject.user !== "root" && (action.id == "org.freedesktop.NetworkManager.settings.modify.system" || action.id == "org.freedesktop.NetworkManager.network-control")) { return polkit.Result.YES; } }); polkit.addRule(function(action, subject) { if (subject.user && subject.user !== "root" && action.id.match(/^org\.freedesktop\.login1\.(reboot|power-off|suspend)/)) { if (subject.active) { return polkit.Result.YES; } else { return polkit.Result.NO; } } });