check user permissions in calendar's unshare.php

This commit is contained in:
Georg Ehrke 2012-05-14 15:33:00 +02:00
parent bda2dbec1f
commit 55eb318265

View file

@ -16,6 +16,14 @@ switch($idtype){
OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
if($idtype == 'calendar' && !OC_Calendar_App::getCalendar($id)){
OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
OCP\JSON::error(array('message'=>'permission denied'));
exit;
}
$sharewith = $_GET['sharewith'];
$sharetype = strip_tags($_GET['sharetype']);
switch($sharetype){