PolicyKit is an authentication system, that lets developers set a policy on specific actions. It works in strict correlation with DBus and ConsoleKit, and it is really useful in cases where you need to perform privileged actions

+

+

== Who is this tutorial for? ==

+

This tutorial is aimed to developers who want their application to perform privileged actions in a secure, consistent and easy way.

+

+

== PolicyKit and KDE ==

+

PolicyKit is closely integrated with KDE starting from version 4.3. In kdebase-workspace we have an authorization manager and an authentication agent. What matters the most, though, is polkit-qt library, in kdesupport, that lets us use the PolicyKit library through a nice Qt-styled API. In this tutorial we will be using it as our main development resource.

+

+

== Prerequisites ==

+

Your application does not need very special prerequisites to be integrated with PolicyKit. Console applications or libraries can also link to polkit-qt-core, that doesn't add a dependency to QtGui.

+

+

As a developer, you probably need to read the [[http://api.kde.org/kdesupport-api/kdesupport-apidocs/polkit-qt/html/|Polkit-qt api documentation]], that is a fundamental compound of this tutorial. A fair knowledge of DBus (have a look at the DBus tutorial series for that) can make your workflow better.

+

+

+

== Special files used by PolicyKit ==

+

Before you start diving into PolicyKit integration, you have to know how a .policy file is made. Those files contain a definition of

What is PolicyKit

PolicyKit is an authentication system, that lets developers set a policy on specific actions. It works in strict correlation with DBus and ConsoleKit, and it is really useful in cases where you need to perform privileged actions

Who is this tutorial for?

This tutorial is aimed to developers who want their application to perform privileged actions in a secure, consistent and easy way.

PolicyKit and KDE

PolicyKit is closely integrated with KDE starting from version 4.3. In kdebase-workspace we have an authorization manager and an authentication agent. What matters the most, though, is polkit-qt library, in kdesupport, that lets us use the PolicyKit library through a nice Qt-styled API. In this tutorial we will be using it as our main development resource.

Prerequisites

Your application does not need very special prerequisites to be integrated with PolicyKit. Console applications or libraries can also link to polkit-qt-core, that doesn't add a dependency to QtGui.

As a developer, you probably need to read the [api documentation], that is a fundamental compound of this tutorial. A fair knowledge of DBus (have a look at the DBus tutorial series for that) can make your workflow better.

Special files used by PolicyKit

Before you start diving into PolicyKit integration, you have to know how a .policy file is made. Those files contain a definition of