scripts: add halt polkit rules
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
8010f1dda2
commit
ea4ec1f424
|
@ -30,6 +30,8 @@ add_polkit_legacy_rules()
|
||||||
ACTIONS="${ACTIONS};org.freedesktop.login1.power-off-multiple-sessions"
|
ACTIONS="${ACTIONS};org.freedesktop.login1.power-off-multiple-sessions"
|
||||||
ACTIONS="${ACTIONS};org.freedesktop.login1.reboot"
|
ACTIONS="${ACTIONS};org.freedesktop.login1.reboot"
|
||||||
ACTIONS="${ACTIONS};org.freedesktop.login1.reboot-multiple-sessions"
|
ACTIONS="${ACTIONS};org.freedesktop.login1.reboot-multiple-sessions"
|
||||||
|
ACTIONS="${ACTIONS};org.freedesktop.login1.halt"
|
||||||
|
ACTIONS="${ACTIONS};org.freedesktop.login1.halt-multiple-sessions"
|
||||||
ACTIONS="${ACTIONS};org.freedesktop.packagekit.*"
|
ACTIONS="${ACTIONS};org.freedesktop.packagekit.*"
|
||||||
sudo /bin/sh -c "cat > ${RULE_FILE}" << EOF
|
sudo /bin/sh -c "cat > ${RULE_FILE}" << EOF
|
||||||
[moonraker permissions]
|
[moonraker permissions]
|
||||||
|
@ -72,6 +74,8 @@ polkit.addRule(function(action, subject) {
|
||||||
action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
|
action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
|
||||||
action.id == "org.freedesktop.login1.reboot" ||
|
action.id == "org.freedesktop.login1.reboot" ||
|
||||||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
|
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
|
||||||
|
action.id == "org.freedesktop.login1.halt" ||
|
||||||
|
action.id == "org.freedesktop.login1.halt-multiple-sessions" ||
|
||||||
action.id.startsWith("org.freedesktop.packagekit.")) &&
|
action.id.startsWith("org.freedesktop.packagekit.")) &&
|
||||||
subject.user == "$USER") {
|
subject.user == "$USER") {
|
||||||
// Only allow processes with the "moonraker-admin" supplementary group
|
// Only allow processes with the "moonraker-admin" supplementary group
|
||||||
|
|
Loading…
Reference in New Issue