From 4549c978b84c61c78d2d5001ffa59017de2286b6 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 18 Jul 2008 19:13:18 +0000 Subject: Fix for can_write_to_container git-svn-id: https://code.elgg.org/elgg/trunk@1481 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 97518e886..17a2a6a6a 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1016,15 +1016,16 @@ if (!$container_guid) return true; $container = get_entity($container_guid); - + if (($container) && ($user)) { + + // If the user can edit the container, they can also write to it + if ($container->canEdit()) return true; + // Basics, see if the user is a member of the group. if ($container instanceof ElggGroup) if (!$container->isMember($user)) return false; - - // If the user can edit the container, they can also write to it - if ($container->canEdit()) return true; // See if anyone else has anything to say return trigger_plugin_hook('container_permissions_check',$entity->type,array('container' => $container, 'user' => $user), false); -- cgit v1.2.3