Skip to content
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

Schedule privilege fixes #828

Merged
merged 3 commits into from
May 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ ChangeLog
* #798: Added an index on `firstoccurence` field in MySQL CalDAV backend. This
should speed up common calendar-query requests.
* #759: DAV\Client is now able to actually correctly resolve relative urls.
* #671: We are no longer checking the `read-free-busy` privilege on individual
calendars during freebusy operations in the scheduling plugin. Instead, we
check the `schedule-query-freebusy` privilege on the target users' inbox,
which validates access for the entire account, per the spec.


3.1.3 (2016-04-06)
Expand Down
7 changes: 4 additions & 3 deletions lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ function scheduleLocalDelivery(ITip\Message $iTipMessage) {
}

if (!$aclPlugin->checkPrivileges($inboxPath, $caldavNS . $privilege, DAVACL\Plugin::R_PARENT, false)) {
$iTipMessage->scheduleStatus = '3.8;organizer did not have the ' . $privilege . ' privilege on the attendees inbox';
$iTipMessage->scheduleStatus = '3.8;insufficient privileges: ' . $privilege . ' is required on the recipient schedule inbox.';
return;
}

Expand Down Expand Up @@ -935,6 +935,9 @@ protected function getFreeBusyForEmail($email, \DateTimeInterface $start, \DateT
$homeSet = $result[0][200][$caldavNS . 'calendar-home-set']->getHref();
$inboxUrl = $result[0][200][$caldavNS . 'schedule-inbox-URL']->getHref();

// Do we have permission?
$aclPlugin->checkPrivileges($inboxUrl, $caldavNS . 'schedule-query-freebusy');

// Grabbing the calendar list
$objects = [];
$calendarTimeZone = new DateTimeZone('UTC');
Expand All @@ -954,8 +957,6 @@ protected function getFreeBusyForEmail($email, \DateTimeInterface $start, \DateT
continue;
}

$aclPlugin->checkPrivileges($homeSet . $node->getName(), $caldavNS . 'read-free-busy');

if (isset($props[$ctz])) {
$vtimezoneObj = VObject\Reader::read($props[$ctz]);
$calendarTimeZone = $vtimezoneObj->VTIMEZONE->getTimeZone();
Expand Down