]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
adding ability to override access regardless of whether the entity is saved in the...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 30 Dec 2010 20:25:10 +0000 (20:25 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 30 Dec 2010 20:25:10 +0000 (20:25 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7777 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/entities.php

index 183d6cb5deea230ff841eb1b5af28bc67f265675..ddbdbe9ab2ac02cb9d4e5598c036885cdbf6883e 100644 (file)
@@ -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;
-       }
 }
 
 /**