Polkit.Permission¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gio.Permission (10), GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)
- Structs:
 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
Virtual Methods¶
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w/co  | 
The action identifier to use for the permission  | 
||
r/w/co  | 
The subject to use for the permission  | 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Class Details¶
- class Polkit.Permission(**kwargs)¶
 - Bases:
 - Abstract:
 No
Polkit.Permissionis aGio.Permissionimplementation. It can be used with e.g. #GtkLockButton. See theGio.Permissiondocumentation for more information.- classmethod new(action_id, subject, cancellable, callback, *user_data)¶
 - Parameters:
 action_id (
str) – The PolicyKit action identifier.subject (
Polkit.SubjectorNone) – APolkit.SubjectorNonefor the current process.cancellable (
Gio.CancellableorNone) – AGio.CancellableorNone.callback (
Gio.AsyncReadyCallbackorNone) – AGio.AsyncReadyCallbackto call when the request is satisfied.
Creates a
Gio.Permissioninstance 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.
- classmethod new_finish(res)¶
 - Parameters:
 res (
Gio.AsyncResult) – AGio.AsyncResultobtained from theGio.AsyncReadyCallbackpassed toPolkit.Permission.new().- Raises:
 - Returns:
 A
Gio.PermissionorNoneif error is set.- Return type:
 
Finishes an operation started with
Polkit.Permission.new().
- classmethod new_sync(action_id, subject, cancellable)¶
 - Parameters:
 action_id (
str) – The PolicyKit action identifier.subject (
Polkit.SubjectorNone) – APolkit.SubjectorNonefor the current process.cancellable (
Gio.CancellableorNone) – AGio.CancellableorNone.
- Raises:
 - Returns:
 A
Gio.PermissionorNoneif error is set.- Return type:
 
Creates a
Gio.Permissioninstance for the PolicyKit action action_id.This is a synchronous failable constructor. See
Polkit.Permission.new() for the asynchronous version.
- get_action_id()¶
 - Returns:
 A string owned by self. Do not free.
- Return type:
 
Gets the PolicyKit action identifier used for self.
- get_subject()¶
 - Returns:
 An object owned by self. Do not free.
- Return type:
 
Gets the subject used for self.
Property Details¶
- Polkit.Permission.props.action_id¶
 - Name:
 action-id- Type:
 - Default Value:
 - Flags:
 
The action identifier to use for the permission.
- Polkit.Permission.props.subject¶
 - Name:
 subject- Type:
 - Default Value:
 - Flags:
 
The
Polkit.Subjectto use for the permission. If not set during construction, it will be set to match the current process.