Skip to content

Commit

Permalink
Added Category permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Chabilall committed Mar 28, 2019
1 parent 2ca1b39 commit ecd12d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/Reporting/class.reporting.plugin.php
Expand Up @@ -97,6 +97,12 @@ public function controller_Report($sender) {
$reportElementModel = new $reportElementModelName();
$reportElement = $reportElementModel->getID($elementID);

$hasPermission = CategoryModel::checkPermission($reportElement->CategoryID, 'Vanilla.Discussion.View');

if (!$hasPermission) {
throw permissionException("Vanilla.Discussion.View");
}

$elementTitle = Gdn_Format::text(getValue('Name', $reportElement, NULL), FALSE);
$elementExcerpt = Gdn_Format::text(getValue('Body', $reportElement, NULL), FALSE);
if (!is_null($elementExcerpt)) {
Expand Down

0 comments on commit ecd12d6

Please sign in to comment.