-
Committer:
Nate Graham
-
Author(s):
Matthias Gerstner
-
Date:
2019-04-02 18:36:29 UTC
-
Revision ID:
git-v1:f26ada834aeac7207d36744d49c16ed43996f471
authority: add support for passing details to polkit
Summary:
Currently polkit-qt-1 doesn't support to pass details during the `checkAuthorization()` call. Details are for example required to employ runtime generated authorization messages that contain placeholders like `"authentication required for accessing $(device)"`. This feature can be helpful to improve the end user experience and security, since the exact context of a privileged operation can be expressed better. Polkit documentation about this details parameter can be found [[ https://www.freedesktop.org/software/polkit/docs/latest/eggdbus-interface-org.freedesktop.PolicyKit1.Authority.html#eggdbus-method-org.freedesktop.PolicyKit1.Authority.CheckAuthorization | here ]].
This change adds alternative versions of `checkAuthorization()` and `checkAuthorizationSync()` that accepts an additional `QMap<QString, QString> details` parameter. In the implementation this map is converted into the required polkit level PolkitDetails type and passed to the according polkit functions as necessary.
To conform with the [[ https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B | KDE binary compatibility policy]] I didn't extend or overload the existing `checkAuthorization()` and `checkAuthorizationSync()` functions, but introduced newly named functions.
Reviewers: #frameworks, chinmoyr, fvogt, bruns, davidedmundson
Reviewed By: bruns, davidedmundson
Subscribers: elvisangelaccio, ngraham, mati865, kde-frameworks-devel
Differential Revision: https://phabricator.kde.org/D18845