Skip to content

Commit

Permalink
Bug: 14118 Move this until after we check the user's calendars.
Browse files Browse the repository at this point in the history
This was preventing an admin from deleting any event he has previously
accepted from an iTip.
  • Loading branch information
mrubinsk committed Oct 20, 2015
1 parent 720644c commit 63c533c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kronolith/lib/Api.php
Expand Up @@ -957,10 +957,6 @@ public function delete($uid, $recurrenceId = null, $range = null)
$events = $kronolith_driver->getByUID($uid, null, true);
$event = null;

if ($GLOBALS['registry']->isAdmin()) {
$event = $events[0];
}

// First try the user's own calendars.
if (empty($event)) {
$ownerCalendars = Kronolith::listInternalCalendars(true, Horde_Perms::DELETE);
Expand All @@ -985,6 +981,11 @@ public function delete($uid, $recurrenceId = null, $range = null)
}
}

// Are we an admin cleaing up user data?
if (empty($event) && $GLOBALS['registry']->isAdmin()) {
$event = $events[0];
}

if (empty($event)) {
throw new Horde_Exception_PermissionDenied();
}
Expand Down

0 comments on commit 63c533c

Please sign in to comment.