1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Deny_All pokit rule added

This commit is contained in:
Игорь Чудов 2019-11-26 15:21:49 +04:00
parent 6b249766b5
commit 95f31c3a33
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -0,0 +1,23 @@
{% if deny_all %}
polkit.addAdminRule(function (action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount-other-seat") {
return polkit.Result.NO;
}
return ["unix-group:wheel"];
});
{% else %}
polkit.addAdminRule(function (action, subject) {
return ["unix-group:wheel"];
});
polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount-other-seat" && subject.isInGroup("users")) {
polkit.log("Mount action from user: " + subject.user + ", pid: " + subject.id + ": allowed");
return polkit.Result.YES;
}
polkit.log("Mount action from user: " + subject.user + ", pid: " + subject.id + ": denied");
return polkit.Result.NO;
});
{% endif %}