summaryrefslogtreecommitdiff
path: root/user/udisks2/50-udisks2.rules
diff options
context:
space:
mode:
Diffstat (limited to 'user/udisks2/50-udisks2.rules')
-rw-r--r--user/udisks2/50-udisks2.rules28
1 files changed, 28 insertions, 0 deletions
diff --git a/user/udisks2/50-udisks2.rules b/user/udisks2/50-udisks2.rules
new file mode 100644
index 000000000..4c6088eaf
--- /dev/null
+++ b/user/udisks2/50-udisks2.rules
@@ -0,0 +1,28 @@
+// Source: https://gist.github.com/Scrumplex/8f528c1f63b5f4bfabe14b0804adaba7
+// Original rules: https://github.com/coldfix/udiskie/wiki/Permissions
+// Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin.
+
+polkit.addRule(function(action, subject) {
+ var YES = polkit.Result.YES;
+ // NOTE: there must be a comma at the end of each line except for the last:
+ var permission = {
+ // required for udisks2:
+ "org.freedesktop.udisks2.filesystem-mount": YES,
+ "org.freedesktop.udisks2.encrypted-unlock": YES,
+ "org.freedesktop.udisks2.eject-media": YES,
+ "org.freedesktop.udisks2.power-off-drive": YES,
+ // Dolphin specific
+ "org.freedesktop.udisks2.filesystem-mount-system": YES,
+ // required for udisks2 if using another seat:
+ "org.freedesktop.udisks2.filesystem-mount-other-seat": YES,
+ "org.freedesktop.udisks2.filesystem-unmount-others": YES,
+ "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES,
+ "org.freedesktop.udisks2.eject-media-other-seat": YES,
+ "org.freedesktop.udisks2.power-off-drive-other-seat": YES
+ };
+ // This is a terrible group choice, but nobody on the Horizon team wanted to
+ // give admins 'disk', which would be so much more appropriate...
+ if (subject.isInGroup("usb")) {
+ return permission[action.id];
+ }
+});