-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add calendar sharing #21964
Add calendar sharing #21964
Conversation
By analyzing the blame information on this pull request, we identified @schiesbn, @nickvergessen, @blizzz and @DeepDiver1975 to be potential reviewers |
0dcdb3d
to
3f88c20
Compare
The response body for the post request is empty and the response code a 200. Shouldn't it be a 204 instead? If I share a calendar with a user and a group the user is also a member of the calendar appears twice:
|
deleting events succeeds in a read-only calendar. |
thx - note to self: use distinct |
I'll have a look - THX |
I used |
by default sharing is read only - you have to add CS:read-write/ to share it writable |
@georgehrke your issues should be addressed now - thanks for testing! |
list(, $name) = URLUtil::splitPath($row['principaluri']); | ||
$uri = $row['uri'] . '_shared_by_' . $name; | ||
$row['displayname'] = $row['displayname'] . "($name)"; | ||
$readOnly = ($row['access'] == Backend::ACCESS_READ); |
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.
maybe add a comment to the code on why you only use ==
instead of ===
Awesome, will retest asap. |
@@ -153,10 +172,63 @@ function getCalendarsForUser($principalUri) { | |||
$calendar[$xmlName] = $row[$dbName]; | |||
} | |||
|
|||
$calendars[] = $calendar; | |||
$calendars[$calendar['id']] = $calendar; |
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.
unshare <?xml version="1.0" encoding="utf-8" ?>
<CS:share xmlns:D="DAV:" xmlns:CS="http://owncloud.org/ns">
<CS:remove>
<D:href>principal:principals/users/user02</D:href>
</CS:remove>
</CS:share> |
Updating permissions is done by just POSTing the set xml again |
this will all happen via the acls which are generated based on the shares which are attached to the calendar. These acls contain e.g. write privilege for the user and read for the group. As soon as a write operation is issued on the calendar alls acl entires are evaluated. So this should work already properly - I'll remove the access property within getCalendarsForUser. |
16b682a
to
82ca5bd
Compare
$this->db = $db; | ||
$this->principalBackend = $principalBackend; | ||
$this->sharingBackend = new Backend($this->db, 'calendar'); |
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.
no DI necessary?
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.
Looking at rest of the code it's ok
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.
not really from my pov since this is there to share common code between the two backends
but I'm happy to discuss this
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.
If I did not miss anything, they were onliners in methods, without further logic, so per se it's sufficient to test the Backend itself. OTOH it leaves a heritage, if the code would change in future.
delete has been fixed |
we have to implement something like https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-sharing.txt#L396 |
IMHO this is ready to be merged once the |
@georgehrke please have a look |
Roger that! |
It seems to respond with a success message, it should return an error code instead. |
I think the behavior that user3 can't unshare the calendar for all members of group1 is correct though. |
Since the share operation works on a list of people to be shared and unshared with error feedback does not really exist ..... anyway - let's see What would be the appropriate status code? 403/Forbidden ? |
Yes, 403 sounds just about right. |
…part of the group
…is part of the group
7d60e3b
to
a3cc448
Compare
@georgehrke ... |
Deleting a calendar still leaves dead entries in |
looks good otherwise |
👍 |
@blizzz could you review again? :) |
Works 👍 |
Test Scenario
You can use cadaver to check for the calendar resources.