<div dir="ltr"><div>In JS-based polkit rules, the action usually comes with 'unit' and 'verb' polkit variables -- according to src/core/dbus-unit.c:<br></div><div><br></div><div> if (<a href="http://action.id" target="_blank">action.id</a> == "org.freedesktop.systemd1.manage-unit" && action.lookup("unit") == "foo.service") { return polkit.Result.YES; }</div><div><br></div><div>In older polkit versions which use .pkla rules, variables are not available at all.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2019 at 6:15 PM Ian Pilcher <<a href="mailto:arequipeno@gmail.com" target="_blank">arequipeno@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am writing a PolicyKit rule to allow a non-root user to restart a<br>
service (via D-bus). It looks like this will be the<br>
org.freedesktop.systemd1.manage-units "action", but I can't see a way to<br>
determine *which* unit is being managed (or what the action is - start/<br>
stop/restart/reload).<br>
<br>
Are there any variables associated with this action that my rule can<br>
use? If not, is there any way to give a particular user permission to<br>
perform only some actions on only some units?<br>
<br>
Thanks!<br>
<br>
-- <br>
========================================================================<br>
Ian Pilcher <a href="mailto:arequipeno@gmail.com" target="_blank">arequipeno@gmail.com</a><br>
-------- "I grew up before Mark Zuckerberg invented friendship" --------<br>
========================================================================<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr">Mantas Mikulėnas</div></div>