/** * Returns if a user can edit this extended data. * * @param int $user_guid The GUID of the user (defaults to currently logged in user) * * @return bool */ public function canEdit($user_guid = 0) { return can_edit_extender($this->id, $this->type, $user_guid); }
function pleio_api_format_comment(ElggAnnotation $a, $user_guid = 0) { $u = get_entity($a->owner_guid); $u = pleio_api_format_user($u); $edit = can_edit_extender($a->id, "annotation", $user_guid); return array("guid" => (int) $a->id, "owner_guid" => $a->owner_guid, "description" => trim($a->value), "time_created" => $a->time_created, "avatar" => $u["avatar"], "name" => $u["name"], "can_edit" => $edit ? 1 : 0); }