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,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);