71 lines
2.6 KiB
Text
71 lines
2.6 KiB
Text
|
polkit.addRule(function(action, subject) {
|
||
|
if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("wheel")) {
|
||
|
return polkit.Result.YES;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
// Allow udisks2 to mount devices without authentication
|
||
|
// for users in the "wheel" group.
|
||
|
polkit.addRule(function(action, subject) {
|
||
|
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
|
||
|
action.id == "org.freedesktop.udisks2.filesystem-mount" ||
|
||
|
action id == "org.freedesktop.udisks2.filesystem-mount-other-seat" ||
|
||
|
action.id == "org.freedesktop.udisks.filesystem-fstab") &&
|
||
|
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.power-off-multiple-sessions" ||
|
||
|
action.id == "org.freedesktop.login1.reboot" ||
|
||
|
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
|
||
|
action.id == "org.freedesktop.login1.hibernate" ||
|
||
|
action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
|
||
|
action.id == "org.freedesktop.login1.suspend" ||
|
||
|
action.id == "org.freedesktop.login1.suspend-multiple-sessions") {
|
||
|
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("wheel")) {
|
||
|
return polkit.Result.YES;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
/* Allow members of the wheel group to execute the defined actions
|
||
|
* without password authentication, similar to "sudo NOPASSWD:"
|
||
|
*/
|
||
|
polkit.addRule(function(action, subject) {
|
||
|
if ((action.id == "org.archlinux.pkexec.gparted" ||
|
||
|
action.id == "org.libvirt.unix.manage") &&
|
||
|
subject.isInGroup("wheel"))
|
||
|
{
|
||
|
return polkit.Result.YES;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
polkit.addRule(function(action, subject) {
|
||
|
if ((action.id == "org.corectrl.helper.init" ||
|
||
|
action.id == "org.corectrl.helperkiller.init") &&
|
||
|
subject.local == true &&
|
||
|
subject.active == true &&
|
||
|
subject.isInGroup("wheel")) {
|
||
|
return polkit.Result.YES;
|
||
|
}
|
||
|
});
|