1

I have set the following Polkit rule to prevent users from rebooting my Fedora 33 machine using Gnome:

polkit.addRule(function(action, subject) {
if ( ( action.id == "org.freedesktop.login1.reboot" ) ||
     ( action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ) ||
     ( action.id == "org.freedesktop.login1.reboot-multiple-sessions" ) ||
     ( action.id == "org.freedesktop.login1.set-reboot-parameter" ) ||
     ( action.id == "org.freedesktop.login1.set-reboot-to-boot-loader-entry " ) ||
     ( action.id == "org.freedesktop.login1.set-reboot-to-boot-loader-menu" ) ||
     ( action.id == "org.freedesktop.login1.set-reboot-to-firmware-setup" ) ) {

    return polkit.Result.AUTH_ADMIN;

}

});

But something is not working as it should be because users still can reboot the machine. Does anyone knows what could be happening?

Edit: I have tried the "*.power-off" actions and they get ignored too...

Edit2: "*.suspend" works as expected but neither "*.power-off" nor "*.reboot" looks to work even if if I try to trigger these rules with pkcheck.

Lord_Rafa
  • 11
  • 3

0 Answers0