From 3d2fc86604cca5df2d9578564f653528063ba24d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 16 Dec 2008 00:30:05 +0000 Subject: Permission only function on albums. --- core/helpers/access.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/access.php b/core/helpers/access.php index badd9b0a..939f4238 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -130,6 +130,12 @@ class access_Core { * @return boolean */ private static function _set($group, $perm_name, $item, $value) { + if (!$item->loaded) { + throw new Exception("@todo INVALID_ITEM $item->id"); + } + if ($item->type != "album") { + throw new Exception("@todo INVALID_ITEM_TYPE not an album"); + } $access = ORM::factory("access_intent")->where("item_id", $item->id)->find(); if (!$access->loaded) { throw new Exception("@todo MISSING_ACCESS for $item->id"); -- cgit v1.2.3