Skip to content

[stable30] Introduce own method for calendar unsharing - #52961

Merged
AndyScherzinger merged 2 commits into
stable30from
backport/52808/stable30
Jun 1, 2025
Merged

[stable30] Introduce own method for calendar unsharing#52961
AndyScherzinger merged 2 commits into
stable30from
backport/52808/stable30

Conversation

@backportbot

@backportbotbackportbotBot commented May 19, 2025

Copy link
Copy Markdown

Backport of #52046

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbotbackportbotBot added bug 3. to review Waiting for reviews labels May 19, 2025
@backportbotbackportbotBot added this to the Nextcloud 30.0.12 milestone May 19, 2025
@solracsfsolracsf changed the title [stable30] [stable31] Introduce own method for calendar unsharing[stable30] Introduce own method for calendar unsharingMay 20, 2025
@kesselbkesselb self-assigned this May 20, 2025
@kesselb
kesselbforce-pushed the backport/52808/stable30 branch from 63de4c7 to 3d05796CompareMay 20, 2025 10:40
@kesselb

Copy link
Copy Markdown
Contributor

Review and resolve any conflicts

Autoloader

}

$principal = $this->principal->getPrincipalByPath('principals/users/' . $user);
if ($principal === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction

array<array-key, mixed> does not contain null
}

$principal = $this->principal->getPrincipalByPath('principals/users/' . $user);
if ($principal === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction

array<array-key, mixed> does not contain null
return true;
}

private function hasAccessByGroupOrCirclesMembership(int $resourceId, string $principal) {

Check notice

Code scanning / Psalm

MissingReturnType

Method OCA\DAV\DAV\Sharing\Backend::hasAccessByGroupOrCirclesMembership does not have a return type, expecting bool
Comment threadapps/dav/lib/Events/CalendarShareUpdatedEvent.php Fixed
@kesselb
kesselbforce-pushed the backport/52808/stable30 branch 3 times, most recently from 9cabbc2 to 1fbcfffCompareMay 20, 2025 11:15
@kesselb
kesselb marked this pull request as ready for review May 20, 2025 11:46
@st3iny

Copy link
Copy Markdown
Member

Conflicts 👀

@kesselb
kesselbforce-pushed the backport/52808/stable30 branch from 1fbcfff to e713c74CompareJune 1, 2025 14:36
@kesselb

Copy link
Copy Markdown
Contributor

Resolved ;)

Was conflicting with my own pr #52995 🙈

kesselb added 2 commits June 1, 2025 16:39
- Introduces a `unshare` method in `CalDavBackend` to handle user unshares.
- Implements check to determine if unshare entry is needed based on group/circle membership.
- Ensures `updateShares` is only used when the calendar owner manages shares.
- Resolves issue where unsharing a calendar as owner created an unshare entry in `oc_dav_shares`.
Related PRs:
- #43117
- #47737
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Before: Find all entries in `dav_shares` with `access = 5` for the user's principal, as well as group and circle memberships.
After: Find all entries in `dav_shares` with `access = 5` solely for the user's principal.
Future support for unsharing group or circle principals could be considered as a feature enhancement.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the backport/52808/stable30 branch from e713c74 to 4c13ef7CompareJune 1, 2025 14:39
@AndyScherzinger
AndyScherzinger merged commit f2ff14e into stable30Jun 1, 2025
@AndyScherzinger
AndyScherzinger deleted the backport/52808/stable30 branch June 1, 2025 18:12
@nextcloud-botnextcloud-bot mentioned this pull request Jun 4, 2025
11 tasks
@nextcloud-botnextcloud-bot mentioned this pull request Sep 18, 2025
@nextcloud-botnextcloud-bot mentioned this pull request Sep 25, 2025
2 tasks
@blizzzblizzz mentioned this pull request Oct 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@kesselb@st3iny@ChristophWurst@github-advanced-security@AndyScherzinger