Wp.PermissionManager

g GObject.Object GObject.Object Wp.Object Wp.Object GObject.Object->Wp.Object Wp.PermissionManager Wp.PermissionManager Wp.Object->Wp.PermissionManager

Subclasses:

None

Methods

Inherited:

Wp.Object (12), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (core)

add_interest_match (callback, user_data, interest)

add_interest_match_closure (closure, interest)

add_interest_match_simple (permissions, interest)

add_rules_match (rules)

get_default_permissions ()

remove_match (match_id)

set_core_permissions (permissions)

set_default_permissions (permissions)

update_permissions ()

Virtual Methods

Inherited:

Wp.Object (4), GObject.Object (7)

Properties

Inherited:

Wp.Object (4)

Signals

Inherited:

GObject.Object (1)

Name

Short Description

client-properties-changed

Fields

Inherited:

GObject.Object (1)

Class Details

class Wp.PermissionManager(**kwargs)
Bases:

Wp.Object

Abstract:

No

Structure:

Wp.PermissionManagerClass

The Wp.PermissionManager class is in charge of updating automatically permissions on interested objects every time they are added or removed for a particular client. Wp.PermissionManager API.

classmethod new(core)
Parameters:

core (Wp.Core) – the Wp.Core

Returns:

a new Wp.PermissionManager object

Return type:

Wp.PermissionManager

Creates a new Wp.PermissionManager object.

add_interest_match(callback, user_data, interest)
Parameters:
Returns:

the added match ID, or SPA_ID_INVALID if error

Return type:

int

Adds an interest match to apply permissions with callback in matched objects.

Interest consists of a GObject.GType that the object must be an ancestor of (GObject.type_is_a() must match) and optionally, a set of additional constraints on certain properties of the object. Refer to Wp.ObjectInterest for more details.

add_interest_match_closure(closure, interest)
Parameters:
Returns:

the added match ID, or SPA_ID_INVALID if error

Return type:

int

Adds an interest match to apply permissions with closure in matched objects.

Interest consists of a GObject.GType that the object must be an ancestor of (GObject.type_is_a() must match) and optionally, a set of additional constraints on certain properties of the object. Refer to Wp.ObjectInterest for more details.

add_interest_match_simple(permissions, interest)
Parameters:
Returns:

the added match ID, or SPA_ID_INVALID if error

Return type:

int

Adds an interest match to apply same permissions in matched objects.

Interest consists of a GObject.GType that the object must be an ancestor of (GObject.type_is_a() must match) and optionally, a set of additional constraints on certain properties of the object. Refer to Wp.ObjectInterest for more details.

add_rules_match(rules)
Parameters:

rules (Wp.SpaJson) – the JSON rules

Returns:

the added match ID, or SPA_ID_INVALID if error

Return type:

int

Adds a rules match to apply permissions in matched objects.

The rules must be defined in a JSON object using the same format as all the wireplumber/pipewire rules.

get_default_permissions()
Returns:

the default permissions

Return type:

int

Gets the default permissions that are applied to all objects that don’t match any interest.

remove_match(match_id)
Parameters:

match_id (int) – the match ID to remove

Removes the previously added match so that the associated permissions are not applied anymore.

set_core_permissions(permissions)
Parameters:

permissions (int) – the permissions to apply to the core object

Sets the permissions that will be applied to the core object (ID 0).

The core object is not visible to the permission manager’s object manager because it is implicit in the PipeWire connection and not sent through the registry. This method allows setting explicit permissions on it, independent of the default permissions. If not set (or set to PW_PERM_INVALID), the core inherits default_permissions.

set_default_permissions(permissions)
Parameters:

permissions (int) – the default permissions to apply

Sets the default permissions that will be applied to all objects that don’t match any interest.

update_permissions()

Updates permissions on all clients the permission manager has.

The permission manager already updates permissions on all clients automatically when a new client or object is added, however, this might be needed if interests with closures or callbacks were added and something changed externally.

Signal Details

Wp.PermissionManager.signals.client_properties_changed(permission_manager, object)
Signal Name:

client-properties-changed

Flags:

RUN_LAST

Parameters: