polkit WIP: enable forgotten config for NetworkManager

and only authorize "active" sessions.
This commit is contained in:
Vladimír Čunát 2013-11-02 12:59:47 +01:00
parent cd49dfd335
commit 1c0fdf2309

View File

@ -40,10 +40,11 @@ let
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
if ( if (
subject.isInGroup("networkmanager") subject.isInGroup("networkmanager")
&& subject.active
&& (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && (action.id.indexOf("org.freedesktop.NetworkManager.") == 0
|| action.id.indexOf("org.freedesktop.ModemManager.") == 0 || action.id.indexOf("org.freedesktop.ModemManager.") == 0
)) ))
{ return polkit.Result.YES; } #TODO: active/inactive { return polkit.Result.YES; }
}); });
''; '';
@ -189,8 +190,7 @@ in {
systemctl restart NetworkManager systemctl restart NetworkManager
''; '';
#TODO security.polkit.extraConfig = polkitConf;
#security.polkit.permissions = polkitConf;
# openvpn plugin has only dbus interface # openvpn plugin has only dbus interface
services.dbus.packages = cfg.packages ++ [ services.dbus.packages = cfg.packages ++ [