aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-25 20:07:44 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-25 20:07:44 +0000
commitdf29af4750c1613771be05b3477a038ca420fc82 (patch)
treee204f0e7a2d3b82aa5c8be3cedda4c1ce4332cb1
parent6a22a33ae10f3e8e32f5992802930298c1c3e12a (diff)
downloadelgg-df29af4750c1613771be05b3477a038ca420fc82.tar.gz
elgg-df29af4750c1613771be05b3477a038ca420fc82.tar.bz2
User test negative non-fatal on permissions check
git-svn-id: https://code.elgg.org/elgg/trunk@1548 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/entities.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 236aa880e..663ac9c4e 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1588,11 +1588,15 @@
$user = get_entity($user_guid);
}
- if (($entity = get_entity($entity_guid)) && (!is_null($user))) {
+ if ($entity = get_entity($entity_guid)) {
- if ($entity->getOwner() == $user->getGUID()) return true;
- if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true;
-
+ // Test user if possible - should default to false unless a plugin hook says otherwise
+ if (!is_null($user))
+ {
+ if ($entity->getOwner() == $user->getGUID()) return true;
+ if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true;
+ }
+
return trigger_plugin_hook('permissions_check',$entity->type,array('entity' => $entity, 'user' => $user),false);
} else {