poc: Use share manager for space membership#2492
poc: Use share manager for space membership#2492rhafer wants to merge 7 commits intoopencloud-eu:mainfrom
Conversation
aduffeck
left a comment
There was a problem hiding this comment.
This looks really nice as a first step.
I suppose in the future we might want to retrieve the list of shared spaces from the space manager too instead of relying on the grants using ListStorageSpaces (analogous to what we do with "regular" shares), but that's something we can discuss later.
| "ocmproviderauthorizersvc": cfg.OCMEndpoint, | ||
| "ocmcoresvc": cfg.OCMEndpoint, | ||
| "commit_share_to_storage_grant": cfg.CommitShareToStorageGrant, | ||
| "use_common_space_root_share_logic": true, |
There was a problem hiding this comment.
Is this actually being used? I didn't find a reference to it in reva.
There was a problem hiding this comment.
It's used in the gateway:
https://github.com/opencloud-eu/reva/blob/main/internal/grpc/services/gateway/gateway.go#L79
We should probably remove that config switch, if we decide to switch to the share-manager.
There was a problem hiding this comment.
Ah, I thought it was a new flag being introduced with your change. Thanks.
1460b5f to
b0c5b1a
Compare
|
Update, I've addressed many of the failing tests. However there is a few things I can't really fix myself:
|
b0c5b1a to
aec01d9
Compare
82a3c5a to
cdebaae
Compare
The |
cdebaae to
bfcd472
Compare
|
The tests that are still failing are:
As already mentioned, all of them are failing because the test suite is making wrong assumptions about the format of the So to remove the access of a specific user from a space. One needs to first list the permissions on that space and then pick the permission id of the permission that belongs to the user. @ScharfViktor would be cool if you could take a look into this. This is a bit above my PHP level. For many of the other failures I've worked around this by just recording the id using |
still failed because user can remove own access even he is the last space manager |
This gets us rid of quite a bit of special casing for space permission. Also provides us with "real" permission IDs instead of those faked "u:<userid>" ones.
The `id` property of the `permissions` on a space root does not longer have that special `u:<userid>` format any. It now has the same format as the permission id on "normal" driveItems.
| default => throw new Exception("shareType '$shareType' does not match user|group|link "), | ||
| }; | ||
| // if recipient is not provided, it means user tries to remove own access, then we need to get the user permission id | ||
| if (!isset($recipient)) { |
There was a problem hiding this comment.
@ScharfViktor This breaks userRemovesLinkFromSpaceUsingRootEndpointOfGraphAPI() I think.
It calls $this->removeAccessToSpace($sharer, 'link', $space) (so $recipient is unset). But it would need $permissionID be set to $this->featureContext->shareNgGetLastCreatedLinkShareID() because of $shareType='link'
64bb3f5 to
1f91075
Compare
I've bumped reva to opencloud-eu/reva@90717df that should have fixed it. |
I can confirm, that it fixed |
We now report a quota of -3 for unlimited quota instead of 0, which clients interpreted as a quota of 0.
|



This is a proof of concept implementation for #2319. (Persisting Space-Membership in the share-manager)
Requires an adjustment to the CS3 API. Basically just an addtional sharefilter-type: rhafer/cs3apis@6333ce5
The required reva changes are here: https://github.com/rhafer/reva/tree/spaces-in-sharemanager. The rest is mainly accomplished by settting
use_common_space_root_share_logictotrue. If we decide to move forward with this I'd suggest to remove that option and make the behavior the default. Should get us rid of a bit more code in reva.As you can see, the changes simplifies the sharing code in the graph service quite a bit as it removes quite a few of the "is this a space root" special cases.