-
-
Save emilio-rst/0737b4ac9a8acd4aa2f4c8f1bf5dd0ed to your computer and use it in GitHub Desktop.
PolKit rules to allow mounting, rebooting and network management without a password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /etc/polkit-1/rules.d/10-rules.rules | |
// PolKit rules to allow mounting, rebooting and network management without a password. | |
// User needs to be in storage, power and network 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("network")) { | |
return polkit.Result.YES; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment