Skip to content

Conversation

@miaulalala
Copy link
Contributor

@miaulalala miaulalala commented Jan 25, 2024

Allow unsharing for a sharee via "Unshare from me" in the calendar dialogue. AFAIK Contacts doesn't have an unshare from me button, maybe something for the frontend devs.

How to test

Scenario 1

  1. Create a group BobsGroup and adds Bob and Eric.
  2. User Alice creates a calendar "Workouts" and shares it with BobsGroup (with edit permission).
  3. Bob unshares the calendar "Workouts" from himself

Expected results:

  1. 2 rows in oc_dav_shares like this:
    image
  2. Bob cannot see "Workouts" any more
  3. Eric can still see workouts
  4. Alice can see the groupshare

Scenario 2

  1. Create a group BobsGroup and adds Bob and Eric.
  2. User Alice creates a calendar "Workouts" and shares it with BobsGroup (with edit permission).
  3. User Alice also shares the calendar "Workouts" with Bob directly:
    image
  4. Bob only sees one share and unshares the calendar "Workouts" from himself

Expected results:

  1. 2 rows in oc_dav_shares like this:
    image
  2. Bob cannot see "Workouts" any more
  3. Eric can still see workouts
  4. Alice can see the groupshare, but not the direct share

Ref #1653

@miaulalala miaulalala added this to the Nextcloud 29 milestone Jan 25, 2024
@miaulalala miaulalala self-assigned this Jan 25, 2024
@miaulalala miaulalala force-pushed the enh/1653/enable-unsharing-for-dav-shares branch from 3131714 to cd7f2f7 Compare January 30, 2024 17:36
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

$cardDavBackend = new CardDavBackend(
$db,
$principalBackend,
\OC::$server->getUserManager(),

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getUserManager has been marked as deprecated
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Tested and works.

return;
}
// Don't add share for owner
if($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) {

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of strcasecmp cannot be null, possibly null value provided
$access = $element['readOnly'] ? self::ACCESS_READ : self::ACCESS_READ_WRITE;
}
// Don't add unshare for owner
if($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) {

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of strcasecmp cannot be null, possibly null value provided
@miaulalala miaulalala marked this pull request as ready for review February 15, 2024 13:48
@miaulalala miaulalala requested review from a team, ArtificialOwl, icewind1991 and sorbaugh and removed request for a team February 15, 2024 13:48
@miaulalala miaulalala added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 15, 2024
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Tested & works

kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 8, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 9, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 11, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 11, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 14, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 15, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 15, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Apr 15, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 9, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 14, 2025
- 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 <[email protected]>
backportbot bot pushed a commit that referenced this pull request May 14, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 15, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 15, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 16, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 19, 2025
- 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 <[email protected]>
backportbot bot pushed a commit that referenced this pull request May 19, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 20, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 20, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request May 20, 2025
- 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 <[email protected]>
mickenordin pushed a commit to mickenordin/server that referenced this pull request May 23, 2025
- 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:
- nextcloud#43117
- nextcloud#47737

Signed-off-by: Daniel Kesselberg <[email protected]>
kesselb added a commit that referenced this pull request Jun 1, 2025
- 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 <[email protected]>
kesselb added a commit that referenced this pull request Jun 1, 2025
- 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 <[email protected]>
AIlkiv pushed a commit to AIlkiv/server that referenced this pull request Jul 10, 2025
- 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:
- nextcloud#43117
- nextcloud#47737

Signed-off-by: Daniel Kesselberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: dav

Projects

Development

Successfully merging this pull request may close these issues.

4 participants