Skip to content

Instantly share code, notes, and snippets.

Last active May 18, 2020 20:22
What would you like to do?
Make polkit allow mounting by user in "storage" group
// Tested with ArchLinux. Cures dolphin/nautilus error "Not authorized to perform action" upon mounting.
// Sources: and
// 1. make sure you are in "storage" group
// 2. create /etc/polkit-1/rules.d/50-udiskie.rules file with the following content
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,
// "": YES,
// "": YES,
// required for udisks2:
"org.freedesktop.udisks2.filesystem-mount": YES,
"org.freedesktop.udisks2.filesystem-mount-system": YES,
"org.freedesktop.udisks2.encrypted-unlock": YES,
"org.freedesktop.udisks2.encrypted-unlock-system": YES,
"org.freedesktop.udisks2.eject-media": YES,
"org.freedesktop.udisks2.eject-media-system": YES,
"org.freedesktop.udisks2.power-off-drive": YES,
"org.freedesktop.udisks2.power-off-drive-system": 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[];
// 3. Try again to mount. No reboot is needed (except if you were not in the "storage" group,
// this one might require reboot or relogin, and is irrelevant to polkit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment