{"record":{"id":"fbdcb1d4e36ac329","repo":"phacility/phabricator","slug":"you-are-not-the-revision-owner-and-this-is-not-a","errorCode":null,"errorMessage":"You are not the revision owner, and this is not a draft comment you authored.","messagePattern":"You are not the revision owner, and this is not a draft comment you authored\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/controller/DifferentialInlineCommentEditController.php","lineNumber":112,"sourceCode":"      ->setViewer($viewer)\n      ->withIDs(array($diff->getRevisionID()))\n      ->executeOne();\n    if (!$revision) {\n      throw new Exception(pht('Unable to load revision.'));\n    }\n\n    $viewer_phid = $viewer->getPHID();\n    $is_owner = ($viewer_phid == $revision->getAuthorPHID());\n    $is_author = ($viewer_phid == $inline->getAuthorPHID());\n    $is_draft = ($inline->isDraft());\n\n    if ($is_owner) {\n      // You own the revision, so you can mark the comment as \"Done\".\n    } else if ($is_author && $is_draft) {\n      // You made this comment and it's still a draft, so you can mark\n      // it as \"Done\".\n    } else {\n      throw new Exception(\n        pht(\n          'You are not the revision owner, and this is not a draft comment '.\n          'you authored.'));\n    }\n\n    return $inline;\n  }\n\n  protected function canEditInlineComment(\n    PhabricatorUser $viewer,\n    DifferentialInlineComment $inline) {\n\n    // Only the author may edit a comment.\n    if ($inline->getAuthorPHID() != $viewer->getPHID()) {\n      return false;\n    }\n\n    // Saved comments may not be edited, for now, although the schema now","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/controller/DifferentialInlineCommentEditController.php#L94-L130","documentation":"Marking an inline comment 'Done' is reserved for the revision owner (for any comment on their revision) or for the comment's author while the comment is still a draft. Anyone else gets this permission error before the inline is returned.","triggerScenarios":"A reviewer who is not the owner clicking 'Done' on someone else's non-draft comment; scripts that perform the done-action as a third user.","commonSituations":"Multiple reviewers on a revision assuming anyone can check off comments; automation tokens running as a shared or wrong account.","solutions":["Let the revision owner perform 'Done', or have the comment author do it while the comment is still a draft.","As a reviewer, reply to the comment instead of marking it done.","For automation, act with the revision author's credentials."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$can_mark_done = ($viewer_phid === $revision->getAuthorPHID()) ||\n  ($viewer_phid === $inline->getAuthorPHID() && $inline->isDraft());\nif (!$can_mark_done) {\n  // do not attempt the 'Done' action; reply instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  // mark the inline comment done\n} catch (Exception $ex) {\n  if (preg_match('/not the revision owner/', $ex->getMessage())) {\n    // downgrade to a normal reply; only the owner may mark done\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Only the revision owner marks comments 'Done'.","Comment authors may do it only while the comment is still a draft.","Run automation with the revision author's credentials, not a shared account."],"tags":["phabricator","differential","inline-comment","permissions"],"backgroundTag":"permission-denied","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}