Set polkit to allow wifi control anywhere for sudo/netdev
- Set AllowAny=yes for NetworkManager polkit rules. This allows users in
sudo/netdev groups to modify NetworkManager settings, regardless of
whether or not they are at a seat.
Change-Id: Id04643c5368a55541e0e720e4ac604c90b02b2ab
diff --git a/debian/postinst b/debian/postinst
index be55ab5..67a90fb 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -23,7 +23,7 @@
echo 'aiy:aiy' |chpasswd
# Create group apex to give aiy user r/w privileges to apex devices
-groupadd apex
+groupadd apex || true
GROUPS="adm audio bluetooth games i2c input plugdev staff sudo users video netdev systemd-journal apex"
diff --git a/etc/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla b/etc/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla
new file mode 100644
index 0000000..46cd21c
--- /dev/null
+++ b/etc/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla
@@ -0,0 +1,6 @@
+[Adding or changing system-wide NetworkManager connections]
+Identity=unix-group:netdev;unix-group:sudo
+Action=org.freedesktop.NetworkManager.*
+ResultAny=yes
+ResultInactive=no
+ResultActive=yes
\ No newline at end of file