Skip to content
This repository has been archived by the owner on Oct 31, 2018. It is now read-only.

Allow only owner of calendar edit shared calendars #385

Closed
wants to merge 3 commits into from
Closed
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: 1 addition & 3 deletions lib/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ public static function addCalendarFromDAVData($principaluri,$uri,$name,$componen
public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null) {
// Need these ones for checking uri
$calendar = self::find($id);
if ($calendar['userid'] != OCP\User::getUser() && !OC_Group::inGroup(OCP\User::getUser(), 'admin')) {
$sharedCalendar = OCP\Share::getItemSharedWithBySource('calendar', $id);
if (!$sharedCalendar || !($sharedCalendar['permissions'] & OCP\PERMISSION_UPDATE)) {
if ($calendar['userid'] != OCP\User::getUser()) {{
throw new Exception(
OC_Calendar_App::$l10n->t(
'You do not have the permissions to update this calendar.'
Expand Down