|  |  |  | polkit Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ||||
| PolkitPermissionPolkitPermission — PolicyKit GPermission implementation | 
PolkitPermission; void polkit_permission_new (const gchar *action_id,PolkitSubject *subject,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); GPermission * polkit_permission_new_finish (GAsyncResult *res,GError **error); GPermission * polkit_permission_new_sync (const gchar *action_id,PolkitSubject *subject,GCancellable *cancellable,GError **error); const gchar * polkit_permission_get_action_id (PolkitPermission *permission); PolkitSubject * polkit_permission_get_subject (PolkitPermission *permission);
"action-id" gchar* : Read / Write / Construct Only "subject" PolkitSubject* : Read / Write / Construct Only
PolkitPermission is a GPermission implementation. It can be used with e.g. GtkLockButton. See the GPermission documentation for more information.
typedef struct _PolkitPermission PolkitPermission;
The PolkitPermission struct should not be accessed directly.
void polkit_permission_new (const gchar *action_id,PolkitSubject *subject,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Creates a GPermission instance for the PolicyKit action
action_id.
When the operation is finished, callback will be invoked. You can
then call polkit_permission_new_finish() to get the result of the
operation.
This is a asynchronous failable constructor. See
polkit_permission_new_sync() for the synchronous version.
| 
 | The PolicyKit action identifier. | 
| 
 | A PolkitSubject or NULLfor the current process. [allow-none] | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | A GAsyncReadyCallback to call when the request is satisfied. | 
| 
 | The data to pass to callback. | 
GPermission * polkit_permission_new_finish (GAsyncResult *res,GError **error);
Finishes an operation started with polkit_permission_new().
| 
 | A GAsyncResult obtained from the GAsyncReadyCallback passed to polkit_permission_new(). | 
| 
 | Return location for error or NULL. [allow-none] | 
| Returns : | A GPermission or NULLiferroris set. | 
GPermission * polkit_permission_new_sync (const gchar *action_id,PolkitSubject *subject,GCancellable *cancellable,GError **error);
Creates a GPermission instance for the PolicyKit action
action_id.
This is a synchronous failable constructor. See
polkit_permission_new() for the asynchronous version.
| 
 | The PolicyKit action identifier. | 
| 
 | A PolkitSubject or NULLfor the current process. [allow-none] | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | Return location for error or NULL. [allow-none] | 
| Returns : | A GPermission or NULLiferroris set. | 
const gchar *       polkit_permission_get_action_id     (PolkitPermission *permission);
Gets the PolicyKit action identifier used for permission.
| 
 | A PolkitPermission. | 
| Returns : | A string owned by permission. Do not free. | 
PolkitSubject *     polkit_permission_get_subject       (PolkitPermission *permission);
Gets the subject used for permission.
| 
 | A PolkitPermission. | 
| Returns : | An object owned by permission. Do not free. [transfer none] | 
"action-id" property"action-id" gchar* : Read / Write / Construct Only
The action identifier to use for the permission.
Default value: NULL
"subject" property"subject" PolkitSubject* : Read / Write / Construct Only
The PolkitSubject to use for the permission. If not set during construction, it will be set to match the current process.