From 4b3f5ecbab46e13201bf06e55dbe5b71ae80a55e Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 30 Dec 2010 20:25:10 +0000 Subject: adding ability to override access regardless of whether the entity is saved in the database yet git-svn-id: http://code.elgg.org/elgg/trunk@7777 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 183d6cb5d..ddbdbe9ab 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1912,8 +1912,8 @@ function can_edit_entity($entity_guid, $user_guid = 0) { $user = get_loggedin_user(); } + $return = false; if ($entity = get_entity($entity_guid)) { - $return = false; // Test user if possible - should default to false unless a plugin hook says otherwise if ($user) { @@ -1932,13 +1932,10 @@ function can_edit_entity($entity_guid, $user_guid = 0) { } } } + } - return elgg_trigger_plugin_hook('permissions_check', $entity->type, + return elgg_trigger_plugin_hook('permissions_check', $entity->type, array('entity' => $entity, 'user' => $user), $return); - - } else { - return false; - } } /** -- cgit v1.2.3