diff --git a/50-default.rules b/50-default.rules new file mode 100644 index 0000000..f427ae1 --- /dev/null +++ b/50-default.rules @@ -0,0 +1,12 @@ +/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ + +// DO NOT EDIT THIS FILE, it will be overwritten on update +// +// Default rules for polkit +// +// See the polkit(8) man page for more information +// about configuring polkit. + +polkit.addAdminRule(function(action, subject) { + return ["unix-group:wheel"]; +}); diff --git a/99-manjaro.rules b/99-manjaro.rules new file mode 100644 index 0000000..aefeca3 --- /dev/null +++ b/99-manjaro.rules @@ -0,0 +1,32 @@ +polkit.addRule(function(action, subject) { + if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("wheel")) { + return polkit.Result.YES; + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.login1.power-off" || + action.id == "org.freedesktop.login1.reboot" || + action.id == "org.freedesktop.login1.hibernate" || + action.id == "org.freedesktop.login1.suspend") { + return polkit.Result.YES; + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.upower.hibernate" || + action.id == "org.freedesktop.upower.suspend") { + return polkit.Result.YES; + } +}); + +/* Allow users of network group to use blueman feature requiring root without authentication */ +polkit.addRule(function(action, subject) { + if ((action.id == "org.blueman.network.setup" || + action.id == "org.blueman.dhcp.client" || + action.id == "org.blueman.rfkill.setstate" || + action.id == "org.blueman.pppd.pppconnect") && + subject.isInGroup("network")) { + return polkit.Result.YES; + } +});