aboutsummaryrefslogtreecommitdiff
path: root/roles/xrdp/files/xrdp_polkit.rules
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-05-26 08:54:15 +0300
committerheqnx <root@heqnx.com>2025-05-26 08:54:15 +0300
commitb702fe9f7f8bf423f753ae89b9617aab2372c05e (patch)
tree09f1237b282709ef51e741a74b21005447e061d6 /roles/xrdp/files/xrdp_polkit.rules
parent08134048cb9a85508042cabd9aa3a39849eca2be (diff)
downloadansible-playbooks-b702fe9f7f8bf423f753ae89b9617aab2372c05e.tar.gz
ansible-playbooks-b702fe9f7f8bf423f753ae89b9617aab2372c05e.zip
added xrdp, added example configs, removing main ones
Diffstat (limited to 'roles/xrdp/files/xrdp_polkit.rules')
-rw-r--r--roles/xrdp/files/xrdp_polkit.rules31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/xrdp/files/xrdp_polkit.rules b/roles/xrdp/files/xrdp_polkit.rules
new file mode 100644
index 0000000..c1fecde
--- /dev/null
+++ b/roles/xrdp/files/xrdp_polkit.rules
@@ -0,0 +1,31 @@
+polkit.addRule(function(action, subject) {
+ if (subject.user && subject.user !== "root" &&
+ (action.id == "org.freedesktop.color-manager.create-device" ||
+ action.id == "org.freedesktop.color-manager.create-profile" ||
+ action.id == "org.freedesktop.color-manager.delete-device" ||
+ action.id == "org.freedesktop.color-manager.delete-profile" ||
+ action.id == "org.freedesktop.color-manager.modify-device" ||
+ action.id == "org.freedesktop.color-manager.modify-profile" ||
+ action.id == "org.debian.apt.update-cache")) {
+ return polkit.Result.YES;
+ }
+});
+
+polkit.addRule(function(action, subject) {
+ if (subject.user && subject.user !== "root" &&
+ (action.id == "org.freedesktop.NetworkManager.settings.modify.system" ||
+ action.id == "org.freedesktop.NetworkManager.network-control")) {
+ return polkit.Result.YES;
+ }
+});
+
+polkit.addRule(function(action, subject) {
+ if (subject.user && subject.user !== "root" &&
+ action.id.match(/^org\.freedesktop\.login1\.(reboot|power-off|suspend)/)) {
+ if (subject.active) {
+ return polkit.Result.YES;
+ } else {
+ return polkit.Result.NO;
+ }
+ }
+});