diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-29 11:43:10 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-29 11:43:10 -0700 |
commit | 38b2efc44cf3345d97798e9637db241b05e2dded (patch) | |
tree | 9440cac4af2623491356ab8bb0c193fea35b1554 /modules/comment/models | |
parent | 27b81257fa3b65de555111372648a65e7152633a (diff) |
Fix for 641... extend viewable functionality to comments. Viewable unit test is not working.
Diffstat (limited to 'modules/comment/models')
-rw-r--r-- | modules/comment/models/comment.php | 10 |
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); + } } |