50-udiskie.rules 647 B

12345678910111213141516171819
  1. polkit.addRule(function(action, subject) {
  2. var YES = polkit.Result.YES;
  3. var permission = {
  4. // only 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. // only 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. };
  15. if (subject.isInGroup("storage")) {
  16. return permission[action.id];
  17. }
  18. });