diff options
author | CyberLeo <cyberleo@cyberleo.net> | 2020-03-28 05:45:52 -0500 |
---|---|---|
committer | CyberLeo <cyberleo@cyberleo.net> | 2020-03-28 05:45:52 -0500 |
commit | 9297468fa579836e3a6a381b798feb6b78217c2d (patch) | |
tree | 53168212f427afbcf0693b534530a4af803152e9 /user/udisks2/50-udisks2.rules | |
parent | a63cc05c53a6f4c22422dc8c69808b14d87a6f6e (diff) | |
parent | da5a69b65a8791fffa6e93366ee585f87eff136d (diff) | |
download | packages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.gz packages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.bz2 packages-9297468fa579836e3a6a381b798feb6b78217c2d.tar.xz packages-9297468fa579836e3a6a381b798feb6b78217c2d.zip |
Merge branch 'master' into zfs
Diffstat (limited to 'user/udisks2/50-udisks2.rules')
-rw-r--r-- | user/udisks2/50-udisks2.rules | 28 |
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]; + } +}); |