aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-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 {