-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Delete CalDav and CardDav shares upon group deletion #57075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
come-nc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct to me but I’d like a review from someone with more knowledge of the dav application.
Signed-off-by: Maximilian Martin <[email protected]>
534a7de to
1fdbc84
Compare
SebastianKrupinski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far...
| public function postDeleteGroup(string $gid): void { | ||
| $this->calDav->deleteAllSharesByUser('principals/groups/' . $gid); | ||
| $this->cardDav->deleteAllSharesByUser('principals/groups/' . $gid); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks for groups with special characters like spaces that get replaced with "+"... Tested with "Test Group A"...
$event->getGroup()->getGID() returns "Test Group A" but the actual uri is "Test+Group+A" so the deletion fails and the group is not deleted.
Also tested with a renamed group, started with "Test Group 2" then renamed to "Test Group B" although the label of the group is changed... the uri stays the same... and the group is not deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
Pushed a new commit. This should fix the first case.
I could not reproduce the second case. Can you check it again with a changed group name without spaces (you have both cases otherwise)?
Signed-off-by: Maximilian Martin <[email protected]>
Summary
Unlike user shares, group shares were not deleted when the group was deleted. This lead to dangling group shares (calenders shared with groups that didn't exist anymore). This PR removes all group shares upon deletion.
Checklist
3. to review, feature component)stable32)