summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-08-29 14:02:29 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-08-29 14:02:29 -0600
commita9fcec755a835e284465bafcc9aba9ec9c2f0f62 (patch)
tree1b6a6029d18ee7cb350f47dd5be54a9bbbbebd17 /modules/comment/models
parent5db0b68a70434a16d8881a6e560a9526530a8a60 (diff)
parent6b633e87489acbe79d65fc5e089d35cc27ee691c (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
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);
+ }
}