Skip to content

@wooptoo /gist:4013294
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PolKit rules to allow mounting, rebooting and network management without a password
// /etc/polkit-1/rules.d/10-rules.rules
// PolKit rules to allow mounting, rebooting and network management without password.
// User needs to be in storage, power and users groups.
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.udisks2.") && subject.isInGroup("storage")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.login1.") && subject.isInGroup("power")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.upower.") && subject.isInGroup("power")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.NetworkManager.") && subject.isInGroup("users")) {
return polkit.Result.YES;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.