summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/access.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-25 13:22:24 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-25 13:22:24 -0800
commit2e420522ece22942a9b3b6ee413ca0e1dfa76148 (patch)
treefd4732002d64e230b04f348941f969c52f763d03 /modules/gallery/helpers/access.php
parente201536d82d6ed49b7c4832f367a01029de05dd6 (diff)
Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add() - Kohana::config_XXX -> Kohana_Config::instance()->XXX - Implement View::set_global in MY_View - Updated Cache_Database_Driver to latest APIs - ORM::$loaded -> ORM::loaded() - Updated item::viewable() to use K2.4 parenthesization
Diffstat (limited to 'modules/gallery/helpers/access.php')
-rw-r--r--modules/gallery/helpers/access.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php
index c1c1f9d1..9d27181a 100644
--- a/modules/gallery/helpers/access.php
+++ b/modules/gallery/helpers/access.php
@@ -91,7 +91,7 @@ class access_Core {
* @return boolean
*/
static function user_can($user, $perm_name, $item) {
- if (!$item->loaded) {
+ if (!$item->loaded()) {
return false;
}
@@ -101,7 +101,7 @@ class access_Core {
$resource = $perm_name == "view" ?
$item : model_cache::get("access_cache", $item->id, "item_id");
- foreach ($user->groups as $group) {
+ foreach ($user->groups->find_all() as $group) {
if ($resource->__get("{$perm_name}_{$group->id}") === self::ALLOW) {
return true;
}
@@ -175,7 +175,7 @@ class access_Core {
->limit(1)
->find();
- if ($lock->loaded) {
+ if ($lock->loaded()) {
return $lock;
} else {
return null;
@@ -201,7 +201,7 @@ class access_Core {
if (!($group instanceof Group_Definition)) {
throw new Exception("@todo PERMISSIONS_ONLY_WORK_ON_GROUPS");
}
- if (!$album->loaded) {
+ if (!$album->loaded()) {
throw new Exception("@todo INVALID_ALBUM $album->id");
}
if (!$album->is_album()) {
@@ -282,7 +282,7 @@ class access_Core {
*/
static function register_permission($name, $display_name) {
$permission = ORM::factory("permission", $name);
- if ($permission->loaded) {
+ if ($permission->loaded()) {
throw new Exception("@todo PERMISSION_ALREADY_EXISTS $name");
}
$permission->name = $name;
@@ -305,7 +305,7 @@ class access_Core {
self::_drop_columns($name, $group);
}
$permission = ORM::factory("permission")->where("name", $name)->find();
- if ($permission->loaded) {
+ if ($permission->loaded()) {
$permission->delete();
}
}
@@ -342,7 +342,7 @@ class access_Core {
*/
static function add_item($item) {
$access_intent = ORM::factory("access_intent", $item->id);
- if ($access_intent->loaded) {
+ if ($access_intent->loaded()) {
throw new Exception("@todo ITEM_ALREADY_ADDED $item->id");
}
$access_intent = ORM::factory("access_intent");
@@ -497,7 +497,7 @@ class access_Core {
->orderby("left_ptr", "DESC")
->limit(1)
->find();
- if ($tmp_item->loaded) {
+ if ($tmp_item->loaded()) {
$item = $tmp_item;
}
}
@@ -568,7 +568,7 @@ class access_Core {
->orderby("left_ptr", "DESC")
->limit(1)
->find();
- if ($tmp_item->loaded) {
+ if ($tmp_item->loaded()) {
$item = $tmp_item;
}
}