Skip to content

Add support for mail grantees - #785

Open
rhafer wants to merge 7 commits into
opencloud-eu:mainfrom
rhafer:persist-guest-shares
Open

Add support for mail grantees#785
rhafer wants to merge 7 commits into
opencloud-eu:mainfrom
rhafer:persist-guest-shares

Conversation

@rhafer

@rhafer rhafer commented Aug 25, 2026

Copy link
Copy Markdown
Member

revived and rebased #616 on top of current master

This PR implements sharing with email addresses as per opencloud-eu/opencloud#2516

@rhafer rhafer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here's some findings that a quick review with the help of opencode revealed. I haven't looked into them a depth. But I think they're mostly valid:

  • High: pkg/storage/pkg/decomposedfs/spaces.go:897 indexes guest spaces by mail, but ListStorageSpaces only reads userSpaceIndex at line 348. Guests cannot discover granted project spaces.
  • Medium: Guest emails are lowercased during persistence in pkg/storage/utils/ace/ace.go:220, but lookup and deletion use original casing at grants.go:330 and node/node.go:1315. Mixed-case guest grants cannot be updated or removed.
  • Medium: Space purge removes user grants only from userSpaceIndex at spaces.go:792, leaving stale guest entries in mailSpaceIndex.

if user.GetId().GetTenantId() != req.GetGrant().GetGrantee().GetUserId().GetTenantId() {
// check if the tenantId of the user matches the tenantId of the target user, skipping guests
if req.GetGrant().GetGrantee().GetUserId().GetType() != userpb.UserType_USER_TYPE_GUEST &&
user.GetId().GetTenantId() != req.GetGrant().GetGrantee().GetUserId().GetTenantId() {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This doesn't align with how the grants are handled for guests. See AddGrant() in : pkg/storage/pkg/decomposedfs/grants.go

Also I am not really sure how we should handle guest invites in a multi-tenancy environment. Somehow I'd think that a guest should also be tied to a specific tenant. So we should remove this change.

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