![]() |
![]() |
![]() |
PolicyKit-gnome Library Reference Manual | ![]() |
---|---|---|---|---|
void (*PolKitGnomeAuthCB) (PolKitAction *action, gboolean gained_privilege, GError *error, gpointer user_data); gboolean polkit_gnome_auth_obtain (PolKitAction *action, guint xid, pid_t pid, PolKitGnomeAuthCB callback, gpointer user_data, GError **error);
void (*PolKitGnomeAuthCB) (PolKitAction *action, gboolean gained_privilege, GError *error, gpointer user_data);
The type of the callback function for
polkit_gnome_auth_show_dialog()
.
|
the PolKitAction passed in polkit_gnome_auth_show_dialog()
|
|
whether the user gained the privilege. Set to FALSE if error is set. If set to TRUE, error will not be set. |
|
if the call failed, this parameter will be non-NULL. The callee shall free the error. |
|
user data |
gboolean polkit_gnome_auth_obtain (PolKitAction *action, guint xid, pid_t pid, PolKitGnomeAuthCB callback, gpointer user_data, GError **error);
Applications can use this function to show a dialog for the user
asking her to authenticate in order to gain privileges to do the
given action. The authentication, for security reasons, happens in
a separate process; this function is merely a wrapper around a
D-Bus call across the session message bus to the
org.freedesktop.PolicyKit.AuthenticationAgent
service. Depending on the setup, this may be the Authentication
Agent shipped with PolicyKit-gnome or it may be another
implementation. For example, if the user is in KDE it may be an
Authentication Agent using the Qt toolkit.
The Authentication Agent shipped with PolicyKit-gnome is described in this section.
This function is similar to the polkit_auth_obtain()
function
supplied in libpolkit-dbus
except that this
function is asynchronous.
|
The PolKitAction to make the user authenticate for |
|
X11 window ID for the window that the dialog will be transient for. If there is no window, pass 0. |
|
Process ID of process to grant authorization to. Normally one wants to pass result of getpid() .
|
|
Function to call when authentication is done |
|
Data to pass to the callback function |
|
Return location for error |
Returns : |
TRUE if the authentication session was scheduled to start. FALSE if error is set (and no callback will be made). |