According to the implementation of the create method (function _comment_resource_create()) of the Comment resource, it can update existing comment. I think it is not nice as we should use update method for that.

// If a cid is present then the user is trying to edit an existing comment.
  if (isset($comment->cid) && ($comment->cid != 0)) {
    $initial_comment = _comment_load($comment->cid);
    $admin = user_access("administer comments");

    if ($initial_comment->uid == 0 && !$admin) {
      return services_error(t("Anonymous comments can't be edited"));
    }

    if (($initial_comment->uid != $comment->uid || comment_num_replies($comment->cid) != 0) && !$admin) {
      return services_error(t("User does not have permission to edit this comment"));
    }
  }

Please advise what do you think about this?

Comments

voxpelli’s picture

I think I agree - the create method shouldn't be used for updating.

kylebrowning’s picture

Status: Active » Needs review
StatusFileSize
new876 bytes

Attached patch for 6.x-3.x

Status: Needs review » Needs work

The last submitted patch, services-1027938.patch, failed testing.

ygerasimov’s picture

Status: Needs work » Needs review

#2: services-1027938.patch queued for re-testing.

kylebrowning’s picture

StatusFileSize
new876 bytes

hrmmm wf is up with the patch bot

kylebrowning’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.