summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/item.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-12-06 21:28:40 -0800
committerBharat Mediratta <bharat@menalto.com>2009-12-06 21:28:40 -0800
commitfb899c313c9cdf4d6b0529c53d2b647999ad94db (patch)
treeb97178b819622490506f6be94f6d9be989a4f839 /modules/gallery/helpers/item.php
parentb9dadb77c3c75c6ba6ead293757df440976b3917 (diff)
Further simplifications to viewable(). Stop trying to optimize for
the case where we just have one restriction, it's unnecessary.
Diffstat (limited to 'modules/gallery/helpers/item.php')
-rw-r--r--modules/gallery/helpers/item.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 300a6942..b7be23cd 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -158,17 +158,9 @@ class item_Core {
$view_restrictions["items.view_$id"] = access::ALLOW;
}
}
- switch (count($view_restrictions)) {
- case 0:
- break;
- case 1:
- $model->where($view_restrictions[0], "=", access::ALLOW);
- break;
-
- default:
+ if (count($view_restrictions)) {
$model->and_open()->or_where($view_restrictions)->close();
- break;
}
return $model;