Wp.PermissionManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Class Details¶
- class Wp.PermissionManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Wp.PermissionManagerclass is in charge of updating automatically permissions on interested objects every time they are added or removed for a particular client.Wp.PermissionManagerAPI.- classmethod new(core)¶
- Parameters:
- Returns:
a new
Wp.PermissionManagerobject- Return type:
Creates a new
Wp.PermissionManagerobject.
- add_interest_match(callback, user_data, interest)¶
- Parameters:
callback (
Wp.PermissionMatchCallback) – the permissions match callbackinterest (
Wp.ObjectInterest) – the interest
- Returns:
the added match ID, or SPA_ID_INVALID if error
- Return type:
Adds an interest match to apply permissions with callback in matched objects.
Interest consists of a
GObject.GTypethat 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 toWp.ObjectInterestfor more details.
- add_interest_match_closure(closure, interest)¶
- Parameters:
closure (
GObject.Closure) – the closure to apply permissionsinterest (
Wp.ObjectInterest) – the interest
- Returns:
the added match ID, or SPA_ID_INVALID if error
- Return type:
Adds an interest match to apply permissions with closure in matched objects.
Interest consists of a
GObject.GTypethat 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 toWp.ObjectInterestfor more details.
- add_interest_match_simple(permissions, interest)¶
- Parameters:
permissions (
int) – the permissions to applyinterest (
Wp.ObjectInterest) – the interest
- Returns:
the added match ID, or SPA_ID_INVALID if error
- Return type:
Adds an interest match to apply same permissions in matched objects.
Interest consists of a
GObject.GTypethat 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 toWp.ObjectInterestfor 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:
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:
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:
- Parameters:
permission_manager (
Wp.PermissionManager) – The object which received the signalobject (
Wp.Client)