mirror of
https://github.com/balkian/dotfiles.git
synced 2024-12-22 16:48:13 +00:00
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
|
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 udisks1:
|
||
|
"org.freedesktop.udisks.filesystem-mount": YES,
|
||
|
"org.freedesktop.udisks.luks-unlock": YES,
|
||
|
"org.freedesktop.udisks.drive-eject": YES,
|
||
|
"org.freedesktop.udisks.drive-detach": YES,
|
||
|
// 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,
|
||
|
// required for udisks2 if using udiskie from another seat (e.g. systemd):
|
||
|
"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
|
||
|
};
|
||
|
if (subject.isInGroup("storage")) {
|
||
|
return permission[action.id];
|
||
|
}
|
||
|
});
|