Story #13146

Updated by Peter Amstutz about 3 years ago

To get "projects shared with me" efficiently requires a new API endpoint. The way arv-mount currently determines what to list in "shared" currently requires looking at all projects and finding the ones where owner_uuid is not another project which is visible to us (meaning: users, non-project groups, or shared subprojects where the parent is not visible). This is expensive to compute on
the client, but can probably be accomplished with a single query on the API server.

Proposed endpoint: /arvados/v1/groups/shared

Query (abbreviated):

* select groups that are readable by current user AND
** the owner_uuid is a user (not a group) OR
** the owner_uuid is a group is not readable by the current user

<pre>
select
@select uuid from groups where
exists(select 1 from materialized_permission_view where user_uuid='2tlax-tpzed-51vcbmac4uv6bpb' and target_uuid=groups.uuid) and
(groups.owner_uuid in (select uuid from users) or
not exists(select 1 from materialized_permission_view where user_uuid='2tlax-tpzed-51vcbmac4uv6bpb' and target_uuid=groups.owner_uuid)) and
owner_uuid != '2tlax-tpzed-51vcbmac4uv6bpb';
</pre>
target_uuid=groups.owner_uuid));@

Back