Manjaro Правила Manjaro Polkit

Правила Manjaro Polkit

From Manjaro
Revision as of 07:03, 2 February 2023 by Krotesk (talk | contribs) (Created page with "Правила - это определения отношений между приложением, пользователем и системой.")
Other languages:
English • ‎Türkçe • ‎français • ‎русский

Что такое polkit?

polkit является менеджером авторизации и помогает системе управлять тем, кому разрешено выполнять определенную задачу.

Что такое правила polkit?

Правила - это определения отношений между приложением, пользователем и системой.

99-manjaro.rules

Manjaro adds some useful rules for actions which would otherwise require the user to authenticate for a given action. The rules added by Manjaro are rules covering where the convenience of the user versus the system security becomes blurred.

Consider the following rules - all part of a ruleset installed on a default Manjaro system.

This first rule enables a user which is member of the administrative group wheel to handle disks and partitions without requiring the user to authenticate. This rule covers the usage of removable USB devices. Because of an overlap with the internal devices this rule also makes it possible for this administrative user to modify the system's internal devices.

polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});

The second rule allows any user to control if the system should be shut down or restarted

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.power-off" ||
        action.id == "org.freedesktop.login1.reboot" ||
        action.id == "org.freedesktop.login1.hibernate" ||
        action.id == "org.freedesktop.login1.suspend") {
        return polkit.Result.YES;
    }
});

The third rule allows the upower daemon to hibernate or suspend the system

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.upower.hibernate" ||
        action.id == "org.freedesktop.upower.suspend") {
        return polkit.Result.YES;
    }
});

The fourth rule allows a member of the network group to use the bluetooth devices without authentication

/* Allow users of network group to use blueman feature requiring root without authentication */
polkit.addRule(function(action, subject) {
    if ((action.id == "org.blueman.network.setup" ||
         action.id == "org.blueman.dhcp.client" ||
         action.id == "org.blueman.rfkill.setstate" ||
         action.id == "org.blueman.pppd.pppconnect") &&
        subject.isInGroup("network")) {
        return polkit.Result.YES;
    }
});

Conclusion

Manjaro has added these rules to make the system easier - you could say less confusing - to the average user.

The rules is included in a file 99-manjaro.rules which is installed/maintained using the package manjaro-hotfixes

Смотрите также

Документация по polkit

--Frede H. 14:02, 13 April 2020 (CEST)

Cookies help us deliver our services. By using our services, you agree to our use of cookies.