diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 10:56:44 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 10:56:44 +0000 |
commit | 5d23a6515d8c62f158c6369fafc6fc9bf0092775 (patch) | |
tree | 8a72b459919317c37596acad6123cf10293485e4 /core/helpers | |
parent | fef188d787fd07fc47e30bd7be46a8982dd71788 (diff) |
Finish writing unit tests for Access. No bugs found!
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/access.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php index e859b1d5..4c623f7c 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -64,8 +64,6 @@ * o In the near future, we'll be moving the "view" columns out of Access_Intent_Model and * directly into Item_Model. By doing this, we'll be able to find viewable items (the most * common permission access) without doing table joins. - * - * o Write unit tests. */ class access_Core { const DENY = 0; @@ -403,12 +401,11 @@ class access_Core { $query = $db->query( "SELECT `access_intents`.`$field`, `items`.`left`, `items`.`right` " . "FROM `access_intents` JOIN (`items`) ON (`access_intents`.`item_id` = `items`.`id`) " . - "WHERE `left` >= ? " . - "AND `right` <= ? " . + "WHERE `left` >= $item->left " . + "AND `right` <= $item->right " . "AND `type` = 'album' " . "AND `$field` IS NOT NULL " . - "ORDER BY `level` ASC ", - array($item->left, $item->right)); + "ORDER BY `level` ASC"); foreach ($query as $row) { $db->query( "UPDATE `access_caches` SET `$field` = {$row->$field} " . |