Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 1 | polkit.addRule(function(action, subject) { |
| 2 | var YES = polkit.Result.YES; |
| 3 | var permission = { |
| 4 | // required for udisks1: |
| 5 | "org.freedesktop.udisks.filesystem-mount": YES, |
| 6 | "org.freedesktop.udisks.luks-unlock": YES, |
| 7 | "org.freedesktop.udisks.drive-eject": YES, |
| 8 | "org.freedesktop.udisks.drive-detach": YES, |
| 9 | // required for udisks2: |
| 10 | "org.freedesktop.udisks2.filesystem-mount": YES, |
| 11 | "org.freedesktop.udisks2.encrypted-unlock": YES, |
| 12 | "org.freedesktop.udisks2.eject-media": YES, |
| 13 | "org.freedesktop.udisks2.power-off-drive": YES, |
| 14 | // required for udisks2 if using udiskie from another seat (e.g. systemd): |
| 15 | "org.freedesktop.udisks2.filesystem-mount-other-seat": YES, |
| 16 | "org.freedesktop.udisks2.filesystem-unmount-others": YES, |
| 17 | "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES, |
| 18 | "org.freedesktop.udisks2.eject-media-other-seat": YES, |
| 19 | "org.freedesktop.udisks2.power-off-drive-other-seat": YES |
| 20 | }; |
| 21 | if (subject.isInGroup("plugdev")) { |
| 22 | return permission[action.id]; |
| 23 | } |
| 24 | }); |