From a9ece1df9137d66797c72f601fe91298168c1f32 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 14 Dec 2017 18:53:05 +0100 Subject: [PATCH] export-sink: add an example permission call --- src/examples/export-sink.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index afa01ef1f..952a7b406 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -541,9 +541,27 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo break; case PW_REMOTE_STATE_CONNECTED: + { + struct spa_dict_item items[3]; + + /* an example, set specific permissions on one object, this is the + * core object, we already have a binding to it that is not affected + * by the removal of X permissions, only future bindings. */ + items[0].key = PW_CORE_PROXY_PERMISSIONS_GLOBAL; + items[0].value = "0:rw-"; + /* set specific permissions on all existing objects without permissions */ + items[1].key = PW_CORE_PROXY_PERMISSIONS_EXISTING; + items[1].value = "r--"; + /* set default permission for new objects and objects without + * specific permissions */ + items[2].key = PW_CORE_PROXY_PERMISSIONS_DEFAULT; + items[2].value = "---"; + pw_core_proxy_permissions(pw_remote_get_core_proxy(data->remote), + &SPA_DICT_INIT(items, SPA_N_ELEMENTS(items))); + make_node(data); break; - + } default: printf("remote state: \"%s\"\n", pw_remote_state_as_string(state)); break;