Using Python to write Polkit rule

Philip Withnall philip at tecnocode.co.uk
Fri Feb 1 10:49:47 UTC 2019


On Fri, 2019-02-01 at 00:18 -0600, Alec Ari wrote:
> Hello,
> 
> This document here:
> 
> https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
> 
> Mentions you can use Python via GObjectIntrospection and 
> libpolkit-gobject-1 library. How do I write a Python rule for Polkit
> as 
> I've removed the JavaScript backend? I want to port 50-default.rules
> to 
> Python and use that language instead. I couldn't find a single
> example 
> online of using Polkit with Python.

libpolkit-gobject-1 is the client library which applications and
services use to query polkit actions and request authorisation. It’s
not the authority backend implementation which makes the authorisation
decisions. Currently, to the best of my knowledge, it’s not possible to
write polkit rules in Python. The manual you’re reading is essentially
saying that it’s possible for a Python program to query polkit about
authorisation for an action.

Philip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/polkit-devel/attachments/20190201/7e005c58/attachment.sig>


More information about the polkit-devel mailing list