Skip to content

fix(ShareApiController): fix listing of remote shares for the owner#59163

Open
szaimen wants to merge 2 commits intomasterfrom
enh/noid/fix-remote-shares-in-controller
Open

fix(ShareApiController): fix listing of remote shares for the owner#59163
szaimen wants to merge 2 commits intomasterfrom
enh/noid/fix-remote-shares-in-controller

Conversation

@szaimen
Copy link
Contributor

@szaimen szaimen commented Mar 23, 2026

Fixes the following problem:

Create a folder (called "Door delen"), which I shared as Projectadmin1 with DashboardAdmin1, with all permissions.

DashboardAdmin1 reshares this folder;

  1. Local with Wes Schibo
  2. Via mail to a user
  3. Via public link
  4. Via OCM FedShare with user@example.com

As Projectadmin1, I can only see reshare number 1, 2 and 3, not the federated reshare (4)

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@szaimen szaimen added this to the Nextcloud 34 milestone Mar 23, 2026
@szaimen
Copy link
Contributor Author

szaimen commented Mar 23, 2026

/backport! to stable32

@szaimen szaimen force-pushed the enh/noid/fix-remote-shares-in-controller branch 2 times, most recently from 1c2b09e to a34738e Compare March 23, 2026 18:48
@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 23, 2026
@szaimen szaimen marked this pull request as ready for review March 23, 2026 19:12
@szaimen szaimen requested review from a team, SebastianKrupinski and kesselb as code owners March 23, 2026 19:12
@szaimen szaimen requested review from Altahrim, icewind1991, leftybournes and salmart-dev and removed request for a team March 23, 2026 19:12
Signed-off-by: Simon L. <szaimen@e.mail.de>
@szaimen szaimen force-pushed the enh/noid/fix-remote-shares-in-controller branch from a34738e to 57967bb Compare March 23, 2026 19:38
@szaimen
Copy link
Contributor Author

szaimen commented Mar 23, 2026

/backport to stable33

Comment on lines +1732 to +1733
// Add federated sharing as a provider only if it's allowed
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
// Include federated sharing whenever the provider is available for the user.
if ($this->shareManager->shareProviderExists(IShare::TYPE_REMOTE)) {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look right to me. You probably want to add the check if the provider exists in addition to the check if federated sharing is allowed. These are two different things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right. Probably the below line changes are enough to make it work.

@szaimen szaimen force-pushed the enh/noid/fix-remote-shares-in-controller branch from 9ee1b57 to fb8682b Compare March 26, 2026 13:56
@szaimen szaimen force-pushed the enh/noid/fix-remote-shares-in-controller branch from fb8682b to a07d1e2 Compare March 26, 2026 13:59
@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Mar 26, 2026
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

I don't understand the issue or the fix based on the PR description and the code changes.

Comment on lines -1857 to +1864
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
if ($this->shareManager->shareProviderExists(IShare::TYPE_REMOTE)) {
$federatedShares = $this->shareManager->getSharesBy(
$this->userId, IShare::TYPE_REMOTE, $node, $reShares, -1, 0
);
$shares = array_merge($shares, $federatedShares);
}

if ($this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
if ($this->shareManager->shareProviderExists(IShare::TYPE_REMOTE_GROUP)) {
Copy link
Member

Choose a reason for hiding this comment

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

Still the same, your're changing what is checked.

…owner

Signed-off-by: Simon L. <szaimen@e.mail.de>
@szaimen szaimen force-pushed the enh/noid/fix-remote-shares-in-controller branch from a07d1e2 to 11b1539 Compare March 26, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants