summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
authorjhilden <jakobhilden@gmail.com>2009-08-29 19:12:57 -0400
committerjhilden <jakobhilden@gmail.com>2009-08-29 19:12:57 -0400
commited9be096535dfbac4d62e0cc74f416a71f67648d (patch)
tree3301809705b4418b97673d8f006332111b42fa5f /modules/comment/models
parent39559fdfd09491dce669d0351768fe2b13ccdd03 (diff)
parent0aceba6f48e5542d3edfbb1f195af50187adbac4 (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);
+ }
}