ObtainAuthorization() seems to return 0 if either - authorization was not allowed. - authorization was previously given. So we must use IsProcessAuthorized() first to really know. This is annoying - it would be simpler if we could just call ObtainAuthorization().
(In reply to comment #0) > ObtainAuthorization() seems to return 0 if either > - authorization was not allowed. > - authorization was previously given. > > So we must use IsProcessAuthorized() first to really know. This is annoying - > it would be simpler if we could just call ObtainAuthorization(). The preferred way to deal with this from a GTK+ application is simply to use PolicyKit-gnome. Then all this crap happens without you knowing and you get subtle hints such as padlock icons and making unobtainable actions insensitive. Why are you not just using PolicyKit-gnome? Anyway, I don't think there's any bug here... feel free to reopen if you disagree. Thanks.
> Why are you not just using PolicyKit-gnome? I'm using Python, and someone (I think you, but maybe I'm wrong) recommended that I use the D-Bus API directly. > Anyway, I don't think there's any bug here... feel free to reopen if you disagree. Thanks. It seems worthwhile for the D-Bus API to act sensibly, or at least be documented, explaining why it works as it does. If it's private and shouldn't be used then by applications ever then that could be documented instead.
Don't you agree that it seems wrong for ObtainAuthorization() to just return 0 if authorization was already given?
This bug report is for the old version of PolicyKit. Closing as all of the code has been rewritten. Please reopen if the bug report applies to the latest version of PolicyKit. Thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.