-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update polkit for NetworkManager service permission
- Part of issue #305. - See also moodlebox/moodle-tool_moodlebox#117.
- Loading branch information
1 parent
07182ed
commit f7d10ee
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
roles/wifi/files/etc/polkit-1/rules.d/10-wifimanagement.rules
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Ref: https://wiki.archlinux.org/title/Polkit | ||
// /etc/polkit-1/rules.d/10-wifimanagement.rules | ||
polkit.addRule(function(action, subject) { | ||
if (action.id == "org.freedesktop.systemd1.manage-units") { | ||
if (action.lookup("unit") == "NetworkManager.service" || | ||
action.lookup("unit") == "networking.service") { | ||
var verb = action.lookup("verb"); | ||
if (verb == "start" || verb == "stop" || verb == "restart") { | ||
return polkit.Result.YES; | ||
} | ||
} | ||
} | ||
}); |
This file contains 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