summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/models')
-rw-r--r--modules/comment/models/comment.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index 83d0888a..de9b0cd6 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -80,4 +80,14 @@ class Comment_Model extends ORM {
return $this;
}
+
+ /**
+ * Add a set of restrictions to any following queries to restrict access only to items
+ * viewable by the active user.
+ * @chainable
+ */
+ public function viewable() {
+ $this->join("items", "items.id", "comments.item_id");
+ return item::viewable($this);
+ }
}