mirror of
https://gitlab.freedesktop.org/pipewire/media-session.git
synced 2025-12-20 06:30:03 +01:00
access: add restricted access permissions
As used when connecting via a network connection.
This commit is contained in:
parent
f715063213
commit
a87008622c
1 changed files with 14 additions and 10 deletions
|
|
@ -93,19 +93,23 @@ static void object_update(void *data)
|
||||||
uint32_t perms;
|
uint32_t perms;
|
||||||
|
|
||||||
if (client->obj->info == NULL || client->obj->info->props == NULL ||
|
if (client->obj->info == NULL || client->obj->info->props == NULL ||
|
||||||
(str = spa_dict_lookup(client->obj->info->props, PW_KEY_ACCESS)) == NULL ||
|
(str = spa_dict_lookup(client->obj->info->props, PW_KEY_ACCESS)) == NULL)
|
||||||
!spa_streq(str, "flatpak"))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((str = spa_dict_lookup(client->obj->info->props, PW_KEY_MEDIA_CATEGORY)) != NULL &&
|
if (spa_streq(str, "flatpak")) {
|
||||||
(spa_streq(str, "Manager"))) {
|
if ((str = spa_dict_lookup(client->obj->info->props, PW_KEY_MEDIA_CATEGORY)) != NULL &&
|
||||||
/* FIXME, use permission store to check if this app is allowed to
|
(spa_streq(str, "Manager"))) {
|
||||||
* be a manager app */
|
/* FIXME, use permission store to check if this app is allowed to
|
||||||
perms = PW_PERM_ALL;
|
* be a manager app */
|
||||||
} else {
|
perms = PW_PERM_ALL;
|
||||||
/* limited access for everything else */
|
} else {
|
||||||
|
/* limited access for everything else */
|
||||||
|
perms = PW_PERM_R | PW_PERM_X;
|
||||||
|
}
|
||||||
|
} else if (spa_streq(str, "restricted")) {
|
||||||
perms = PW_PERM_R | PW_PERM_X;
|
perms = PW_PERM_R | PW_PERM_X;
|
||||||
}
|
} else
|
||||||
|
return;
|
||||||
|
|
||||||
pw_log_info("%p: flatpak client %d granted 0x%08x permissions"
|
pw_log_info("%p: flatpak client %d granted 0x%08x permissions"
|
||||||
, impl, client->id, perms);
|
, impl, client->id, perms);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue