Автор: funk2256@funk2256-manjaro-pc, 1 Год назад, написана на языке Plain Text.
Встраивание на сайт
  1. polkit.addRule(function(action, subject) {
  2.     if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("wheel")) {
  3.         return polkit.Result.YES;
  4.     }
  5. });
  6.  
  7. polkit.addRule(function(action, subject) {
  8.     if (action.id == "org.freedesktop.login1.power-off" ||
  9.         action.id == "org.freedesktop.login1.reboot" ||
  10.         action.id == "org.freedesktop.login1.hibernate" ||
  11.         action.id == "org.freedesktop.login1.suspend") {
  12.         return polkit.Result.YES;
  13.     }
  14. });
  15.  
  16. polkit.addRule(function(action, subject) {
  17.     if (action.id == "org.freedesktop.upower.hibernate" ||
  18.         action.id == "org.freedesktop.upower.suspend") {
  19.         return polkit.Result.YES;
  20.     }
  21. });
  22.  
  23. /* Allow users of network group to use blueman feature requiring root without authentication */
  24. polkit.addRule(function(action, subject) {
  25.     if ((action.id == "org.blueman.network.setup" ||
  26.          action.id == "org.blueman.dhcp.client" ||
  27.          action.id == "org.blueman.rfkill.setstate" ||
  28.          action.id == "org.blueman.pppd.pppconnect") &&
  29.         subject.isInGroup("network")) {
  30.         return polkit.Result.YES;
  31.     }
  32. });