aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop
blob: 5cab6db56d3fef363825a43291300b6a31998bfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
polkit.addRule(function (action, subject) {
$(if [ "${polkit_disable_suspend:-}" = true ]; then cat <<EOF
  if (action.id == "org.freedesktop.consolekit.system.suspend" ||
      action.id == "org.freedesktop.consolekit.system.hibernate") {
    return polkit.Result.NO;
  }
EOF
fi)
  if ((action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop" ||
      action.id == "org.freedesktop.consolekit.system.suspend")
      && subject.isInGroup("${desktop_access_role}")) {
    return polkit.Result.YES;
  }
});