Only allow comment creator to delete comment
This commit is contained in:
parent
bef06fb3f3
commit
a1c8892afa
1 changed files with 7 additions and 3 deletions
|
@ -540,12 +540,16 @@ class TasksController extends Controller {
|
|||
$vcalendar = \OC_Calendar_App::getVCalendar($taskId);
|
||||
$vtodo = $vcalendar->VTODO;
|
||||
$commentIndex = $this->getCommentById($vtodo,$commentId);
|
||||
unset($vtodo->children[$commentIndex]);
|
||||
\OC_Calendar_Object::edit($taskId, $vcalendar->serialize());
|
||||
$comment = $vtodo->children[$commentIndex];
|
||||
if($comment['USERID'] == $userId){
|
||||
unset($vtodo->children[$commentIndex]);
|
||||
\OC_Calendar_Object::edit($taskId, $vcalendar->serialize());
|
||||
}else{
|
||||
throw new \Exception('Not allowed.');
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
// throw new BusinessLayerException($e->getMessage());
|
||||
}
|
||||
$response->setData();
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue