CommentController: Restrict display of single comments

refs #9009
This commit is contained in:
Johannes Meyer 2015-06-15 15:58:15 +02:00
parent 1a08102531
commit b83abc4dbc
1 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class Monitoring_CommentController extends Controller
{
$commentId = $this->params->getRequired('comment_id');
$this->comment = $this->backend->select()->from('comment', array(
$query = $this->backend->select()->from('comment', array(
'id' => 'comment_internal_id',
'objecttype' => 'object_type',
'comment' => 'comment_data',
@ -38,8 +38,10 @@ class Monitoring_CommentController extends Controller
'service_description',
'host_display_name',
'service_display_name'
))->where('comment_internal_id', $commentId)->getQuery()->fetchRow();
))->where('comment_internal_id', $commentId);
$this->applyRestriction('monitoring/filter/objects', $query);
$this->comment = $query->getQuery()->fetchRow();
if ($this->comment === false) {
$this->httpNotFound($this->translate('Comment not found'));
}