Fix for 641... extend viewable functionality to comments. Viewable unit test is not working.

This commit is contained in:
Tim Almdal
2009-08-29 11:43:10 -07:00
parent 27b81257fa
commit 38b2efc44c
5 changed files with 158 additions and 64 deletions

View File

@@ -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);
}
}