aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-02-06 14:04:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-02-06 14:04:24 +0100
commit13cb331be9b94943eb58378e9926c4097b04d198 (patch)
treec18f2e9b9a64e30396862e744cc390c937d28ee5 /data
parenta5e0cdb184fc8cdf486ac009fb079b29e1fd1b40 (diff)
parent0db687fa2d86a5dee9a9a25eac9342acf260ab87 (diff)
downloadarctica-greeter-13cb331be9b94943eb58378e9926c4097b04d198.tar.gz
arctica-greeter-13cb331be9b94943eb58378e9926c4097b04d198.tar.bz2
arctica-greeter-13cb331be9b94943eb58378e9926c4097b04d198.zip
Merge branch 'Ionic-feature/polkit-0.106'
Attributes GH PR #101: https://github.com/ArcticaProject/arctica-greeter/pull/101
Diffstat (limited to 'data')
-rw-r--r--data/50-org.Arctica-Project.arctica-greeter.rules33
-rw-r--r--data/Makefile.am5
-rw-r--r--data/arctica-greeter.pkla12
3 files changed, 44 insertions, 6 deletions
diff --git a/data/50-org.Arctica-Project.arctica-greeter.rules b/data/50-org.Arctica-Project.arctica-greeter.rules
new file mode 100644
index 0000000..b194628
--- /dev/null
+++ b/data/50-org.Arctica-Project.arctica-greeter.rules
@@ -0,0 +1,33 @@
+polkit.addRule (function (action, subject) {
+ if (subject.user == "lightdm") {
+ switch (action.id) {
+ // Disable Controlling of Network Devices
+ case 'org.freedesktop.NetworkManager.enable-disable-network':
+ case 'org.freedesktop.NetworkManager.enable-disable-wifi':
+ case 'org.freedesktop.NetworkManager.enable-disable-wwan':
+ case 'org.freedesktop.NetworkManager.enable-disable-wimax':
+ // Disable Sleep and Wake
+ case 'org.freedesktop.NetworkManager.sleep-wake':
+ // Disable WiFi Sharing
+ case 'org.freedesktop.NetworkManager.wifi.share.protected':
+ case 'org.freedesktop.NetworkManager.wifi.share.open':
+ // Disable Settings Modifications
+ case 'org.freedesktop.NetworkManager.settings.modify.own':
+ case 'org.freedesktop.NetworkManager.settings.modify.system':
+ case 'org.freedesktop.NetworkManager.settings.modify.hostname':
+ // Disable User Connections
+ case 'org.freedesktop.NetworkManager.use-user-connections':
+ // Enable Controlling of Network Connections
+ case 'org.freedesktop.NetworkManager.network-control':
+ return polkit.Result.NO;
+ break;
+ default:
+ /*
+ * Do nothing... for now.
+ *
+ * This means that polkit will continue scanning for other rules.
+ */
+ break;
+ }
+ }
+});
diff --git a/data/Makefile.am b/data/Makefile.am
index c06a300..8975d24 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -26,6 +26,11 @@ pkla_policy_DATA = \
arctica-greeter.pkla \
$(NULL)
+rules_policydir = $(datadir)/polkit-1/rules.d/
+rules_policy_DATA = \
+ 50-org.Arctica-Project.arctica-greeter.rules \
+ $(NULL)
+
arctica-greeter-guest-session-startup.desktop: arctica-greeter-guest-session-startup.desktop.in
$(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
diff --git a/data/arctica-greeter.pkla b/data/arctica-greeter.pkla
index 99235c2..072c1db 100644
--- a/data/arctica-greeter.pkla
+++ b/data/arctica-greeter.pkla
@@ -6,39 +6,39 @@ Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.enable-disable-network;org.freedesktop.NetworkManager.enable-disable-wifi;org.freedesktop.NetworkManager.enable-disable-wwan;org.freedesktop.NetworkManager.enable-disable-wimax;
ResultActive=no
ResultInactive=no
-ResultsAny=no
+ResultAny=no
[Disable Sleep and Wake]
Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.sleep-wake
ResultActive=no
ResultInactive=no
-ResultsAny=no
+ResultAny=no
[Disable WiFi Sharing]
Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.wifi.share.protected;org.freedesktop.NetworkManager.wifi.share.open
ResultActive=no
ResultInactive=no
-ResultsAny=no
+ResultAny=no
[Disable Settings Modifications]
Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.settings.modify.own;org.freedesktop.NetworkManager.settings.modify.system;org.freedesktop.NetworkManager.settings.modify.hostname
ResultActive=no
ResultInactive=no
-ResultsAny=no
+ResultAny=no
[Disable User Connections]
Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.use-user-connections
ResultActive=no
ResultInactive=no
-ResultsAny=no
+ResultAny=no
[Enable Controlling of Network Connections]
Identity=unix-user:lightdm
Action=org.freedesktop.NetworkManager.network-control
ResultActive=yes
ResultInactive=no
-ResultsAny=no
+ResultAny=no