From af8c74f6125478450072fd105d54172dcba1bf8e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Dec 2008 20:06:20 +0000 Subject: Fix a bug where parent permissions were not getting inherited to newly created albums and photos. --- core/helpers/access.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/access.php b/core/helpers/access.php index 3fb7548d..badd9b0a 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -250,6 +250,10 @@ class access_Core { * @return void */ public static function add_item($item) { + $access_intent = ORM::factory("access_intent", $item->id); + if ($access_intent->loaded) { + throw new Exception("@todo ITEM_ALREADY_ADDED $item->id"); + } $access_intent = ORM::factory("access_intent"); $access_intent->item_id = $item->id; $access_intent->save(); @@ -269,6 +273,7 @@ class access_Core { } } } + $item->save(); $access_cache->save(); } -- cgit v1.2.3