Skip to content

Conversation

@jessegeens
Copy link
Contributor

@jessegeens jessegeens commented Sep 9, 2025

This PR allows admins of a project to see all shares on resources in this project, not only their own ones.

To do this, we set the .Space property of a ResourceInfo on a Stat to its respective space, which allows any caller to check if the current user is an admin of the project. This is only done if a specific key is set in the opaques of the StatRequest, to prevent fetching spaces when it is not needed, and to prevent infinite loops (since fetching a space will cause a Stat to get the mtime of the space)

Additionally, the cache has been changed to accept Generics, so that we could also introduce a cache for StorageSpaces instead of only ResourceInfos. These new ones are registered under memory_space and redis_space.

@update-docs

This comment was marked as resolved.

@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch 29 times, most recently from 2140d97 to eb8ae15 Compare September 9, 2025 14:50
@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch 5 times, most recently from 0bca173 to 06d81ff Compare September 17, 2025 14:37
Some modifications to the ways shares are listed to allow project admins to view shares
This auto-injected filter was removed in the plugins by cernbox/reva-plugins#51
@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch 2 times, most recently from 0491fbe to 13cbdeb Compare September 17, 2025 14:50
@jessegeens jessegeens marked this pull request as ready for review September 17, 2025 14:50
@jessegeens jessegeens changed the title WIP: show shares to project admins show shares to project admins Sep 17, 2025
@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch from 13cbdeb to 094a817 Compare September 18, 2025 13:08
@jessegeens jessegeens changed the title show shares to project admins Show shares to project admins Sep 19, 2025
Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's all fine, at least as far as I understand and followed the developments. Just a couple of comments

@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch 2 times, most recently from 802b880 to 7d79c9f Compare September 24, 2025 09:49
@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch from 7d79c9f to 9778b65 Compare September 24, 2025 10:00
When you fetch a storage space, a Stat call happens to the root of the storage space to get the space's mtime.
However, to allow project admins to fetch all shares, we would need to set the `.Space` property of a resource info in a Stat, which could lead to an infinite loop. Therefore, this commit only does the fetching of a space when a special value in the opaques is set.

To do this efficiently, a space info cache was also added to the StorageProvider
@jessegeens jessegeens force-pushed the feat/proj-admin-shares branch from 9778b65 to e7ade75 Compare September 24, 2025 11:11
@glpatcern glpatcern merged commit 64f6201 into master Sep 24, 2025
15 checks passed
@jessegeens jessegeens deleted the feat/proj-admin-shares branch September 26, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants