access: add restricted access permissions

As used when connecting via a network connection.
This commit is contained in:
Wim Taymans 2022-04-19 20:06:48 +02:00
parent f715063213
commit a87008622c

View file

@ -93,10 +93,10 @@ static void object_update(void *data)
uint32_t perms;
if (client->obj->info == NULL || client->obj->info->props == NULL ||
(str = spa_dict_lookup(client->obj->info->props, PW_KEY_ACCESS)) == NULL ||
!spa_streq(str, "flatpak"))
(str = spa_dict_lookup(client->obj->info->props, PW_KEY_ACCESS)) == NULL)
return;
if (spa_streq(str, "flatpak")) {
if ((str = spa_dict_lookup(client->obj->info->props, PW_KEY_MEDIA_CATEGORY)) != NULL &&
(spa_streq(str, "Manager"))) {
/* FIXME, use permission store to check if this app is allowed to
@ -106,6 +106,10 @@ static void object_update(void *data)
/* 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;
} else
return;
pw_log_info("%p: flatpak client %d granted 0x%08x permissions"
, impl, client->id, perms);