summaryrefslogtreecommitdiff
path: root/modules/comment/models/comment.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-29 12:24:44 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-29 12:24:44 -0700
commit6b633e87489acbe79d65fc5e089d35cc27ee691c (patch)
tree6a8a8bdddd27f5f39f76d9aea080d6112e7eea1d /modules/comment/models/comment.php
parent35f83ff31d8422e56c417ac761272168a97c8546 (diff)
parentcd1fd4989f394f6e8084b8101a8dbdb3030c52aa (diff)
Merge branch 'talmdal_branch' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/comment/models/comment.php')
-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);
+ }
}