aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-07 14:31:25 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-07 14:31:25 +0000
commitdba0e07bd47324501123090ef6159b07a672d004 (patch)
tree8051c31d5e6d0d48fe0e593f79917d708293e325 /engine/lib/entities.php
parentd06f87fadb1b88f8ae251ada0461dd2cebf84a00 (diff)
downloadelgg-dba0e07bd47324501123090ef6159b07a672d004.tar.gz
elgg-dba0e07bd47324501123090ef6159b07a672d004.tar.bz2
Much better handling for deleting entities and metadata
git-svn-id: https://code.elgg.org/elgg/trunk@409 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index eba5b8a4d..9d7f98079 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -681,10 +681,10 @@
// TODO Make sure this deletes all metadata/annotations/relationships/etc!!
$guid = (int)$guid;
-
- $access = get_access_list();
-
- return delete_data("DELETE from {$CONFIG->dbprefix}entities where where guid=$guid and (access_id in {$access} or (access_id = 0 and owner_guid = {$_SESSION['id']}))");
+ $entity = get_entity($guid);
+
+ if ($entity->canEdit())
+ return delete_data("DELETE from {$CONFIG->dbprefix}entities where where guid=$guid");
}