aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index f2b9e16fb..7e8caaab6 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -397,18 +397,24 @@
$guid = (int)$guid;
$name = get_metastring_id($name);
+
+ $entity_guid = (int)$entity_guid;
+ if ($entity = get_entity($entity_guid)) {
+ if ($entity->canEdit()) {
- $where = array();
-
- if ($name != "")
- $where[] = " name_id='$name'";
-
- $query = "DELETE from {$CONFIG->dbprefix}annotations where entity_guid=$guid and ";
- foreach ($where as $w)
- $query .= " $w and ";
- $query .= "(access_id in {$access} or (access_id = 0 and owner_guid = {$_SESSION['id']}))";
-
- return delete_data();
+ $where = array();
+
+ if ($name != "")
+ $where[] = " name_id='$name'";
+
+ $query = "DELETE from {$CONFIG->dbprefix}annotations where entity_guid=$guid ";
+ foreach ($where as $w)
+ $query .= " and $w";
+
+ return delete_data($query);
+
+ }
+ }
}
/**