-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
CalDavBackend, implement SharingSupport interface. #36766
CalDavBackend, implement SharingSupport interface. #36766
Conversation
$principalUri = $calendarInfo['principaluri']; | ||
$calendarUri = $calendarInfo['uri']; | ||
$shareable = new Calendar($this, $calendarInfo, \OCP\Util::getL10N('dav'), $this->config, $this->logger); | ||
$this->updateShares($shareable, $additions, $removals); |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion
Signed-off-by: Claus-Justus Heine <[email protected]>
428e3d4
to
1c6f5fc
Compare
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.
First of all, thanks for the effort. As #26668 hints, this might be valuable in the long term.
In the short term, though, it shouldn't bring much: the exposed API is very similar to what we currently have with the oc-resource-sharing
custom plugin, which was based on Sabre's experiments at the time, themselves based on CalendarServer custom's spec.
Since all of @evert's drafts have long expired and Apple has abandoned CalendarServer, it's not sure if it's worth it to pursue in this direction until we have hints of the ecosystem going into the same direction (it's been 7 years since the drafts publication, and 4 years since the last mention of this in the CalConnect/IETF discussions that I can find).
Another thing is that SharingSupport is very linked to NotificationSupport
(as seen in the Sharing plugin calling sharingReply
(as derived from the CS origin).
The notification plugin even says CalDAV-sharing requires it. So that's a whole other thing, even if it would bring nice to have features, such as macOS/iOS calendar clients eventual compatibility.
@@ -436,6 +441,9 @@ public function getCalendarsForUser($principalUri) { | |||
$calendar = $this->addOwnerPrincipalToCalendar($calendar); | |||
$calendar = $this->addResourceTypeToCalendar($row, $calendar); | |||
|
|||
$calendar['{DAV:}share-resource-uri'] = '/ns/share/' . $calendar['id']; | |||
$calendar['{DAV:}share-access'] = $row['access']; |
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.
issue (blocking): The access
values we use are (see ACCESS_PUBLIC
in this file and ACCESS_*
in OCA\DAV\DAV\Sharing\Backend
) different from the ones declared Sabre\DAV\Sharing\Plugin
. You need to convert them.
@@ -362,6 +364,9 @@ public function getCalendarsForUser($principalUri) { | |||
$calendar = $this->addOwnerPrincipalToCalendar($calendar); | |||
$calendar = $this->addResourceTypeToCalendar($row, $calendar); | |||
|
|||
$calendar['{DAV:}share-resource-uri'] = '/ns/share/' . $calendar['id']; |
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.
thought: Not a fan of this. The PDO backend does the exact same, but is this form even a valid URI?
// updateShares() needs a IShareable, i.e. a Calendar object. This is | ||
// really hacky now ... and inefficient ... |
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.
suggestion: This restriction and the whole current implementation of updateShares
& getShares
is oriented to match the current OCA\DAV\DAV\Sharing\Plugin
way of handling shares.
Sharing addressbooks would be the only reason to keep it if we have this instead, so if we manage to overcome that, we could refactor the whole thing.
$result[] = new Sharee([ | ||
'href' => $share['href'], | ||
'access' => $share['readOnly'] ? \Sabre\DAV\Sharing\Plugin::ACCESS_READ : \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE, | ||
'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED, |
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.
thought: This makes me want invite support. :D
@rotdrop following @tcitworld 's comment, it seems like this PR won't be pursued any longer? Please let me know if you'd like us to reopen this! |
Summary
Implement the
\Sabre\CalDAV\Backend\SharingSupport
in\OCA\DAV\CalDAV\CalDavBackend
. The starting comment of the linked issue #26668 suggests that this might be the first step in supporting invitations for events in shared writeable calendars. However, after coding #36756 I have now the impression that the CalDAV sharing interface is orthogonal to sending invitations for events in shared calendars. It is nice to have and may help the calendar frontend (see nextcloud/calendar#4983). However, implementing the "SharingSupport" interface in the CalDAV backend does not bring us closer to sending invitations.TODO
Checklist