diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index 07968dfc8..d20cec0c2 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -34,10 +34,6 @@ foreach ($object->comments as $comment) { $this->escape($comment->comment) ) : $this->escape($comment->comment); - - $form = clone $delCommentForm; - $form->populate(array('comment_id' => $comment->id)); - ?> @@ -46,7 +42,12 @@ foreach ($object->comments as $comment) {
- (type) ?>): + populate(array('comment_id' => $comment->id)); + echo $form; + } ?> + (type) ?>): ', $text) ?> diff --git a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php index cb87d22ad..8cbea2d37 100644 --- a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php +++ b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php @@ -72,7 +72,7 @@ abstract class MonitoredObjectController extends Controller } } } - if (count($this->object->comments) > 0) { + if (count($this->object->comments) > 0 && $auth->hasPermission('monitoring/command/comment/delete')) { $delCommentForm = new DeleteCommentCommandForm(); $delCommentForm ->setObjects($this->object)