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.Permission
is aGio.Permission
implementation. It can be used with e.g. #GtkLockButton. See theGio.Permission
documentation for more information.- classmethod new(action_id, subject, cancellable, callback, *user_data)¶
- Parameters:
action_id (
str
) – The PolicyKit action identifier.subject (
Polkit.Subject
orNone
) – APolkit.Subject
orNone
for the current process.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the request is satisfied.
Creates a
Gio.Permission
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.
- classmethod new_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – AGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toPolkit.Permission.new
().- Raises:
- Returns:
A
Gio.Permission
orNone
if 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.Subject
orNone
) – APolkit.Subject
orNone
for the current process.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.
- Raises:
- Returns:
A
Gio.Permission
orNone
if error is set.- Return type:
Creates a
Gio.Permission
instance 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.Subject
to use for the permission. If not set during construction, it will be set to match the current process.