Polkit.Permission

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Gio.Permission Gio.Permission GObject.Object->Gio.Permission Polkit.Permission Polkit.Permission Gio.AsyncInitable->Polkit.Permission Gio.Initable->Polkit.Permission Gio.Permission->Polkit.Permission

Subclasses:

None

Methods

Inherited:

Gio.Permission (10), GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (action_id, subject, cancellable, callback, *user_data)

class

new_finish (res)

class

new_sync (action_id, subject, cancellable)

get_action_id ()

get_subject ()

Virtual Methods

Inherited:

Gio.Permission (6), GObject.Object (7), Gio.AsyncInitable (2), Gio.Initable (1)

Properties

Inherited:

Gio.Permission (3)

Name

Type

Flags

Short Description

action-id

str

r/w/co

The action identifier to use for the permission

subject

Polkit.Subject

r/w/co

The subject to use for the permission

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Polkit.Permission(**kwargs)
Bases:

Gio.Permission, Gio.AsyncInitable, Gio.Initable

Abstract:

No

Polkit.Permission is a Gio.Permission implementation. It can be used with e.g. #GtkLockButton. See the Gio.Permission documentation for more information.

classmethod new(action_id, subject, cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to Polkit.Permission.new().

Raises:

GLib.Error

Returns:

A Gio.Permission or None if error is set.

Return type:

Gio.Permission

Finishes an operation started with Polkit.Permission.new().

classmethod new_sync(action_id, subject, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

A Gio.Permission or None if error is set.

Return type:

Gio.Permission

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:

str

Gets the PolicyKit action identifier used for self.

get_subject()
Returns:

An object owned by self. Do not free.

Return type:

Polkit.Subject

Gets the subject used for self.

Property Details

Polkit.Permission.props.action_id
Name:

action-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The action identifier to use for the permission.

Polkit.Permission.props.subject
Name:

subject

Type:

Polkit.Subject

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Polkit.Subject to use for the permission. If not set during construction, it will be set to match the current process.