{"record":{"id":"0e6cb265c996fdd9","repo":"phacility/phabricator","slug":"err-permissions","errorCode":"ERR-PERMISSIONS","errorMessage":"Only admins can call this method.","messagePattern":"Only admins can call this method\\.","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/people/conduit/UserDisableConduitAPIMethod.php","lineNumber":41,"sourceCode":"      'phids' => 'required list<phid>',\n    );\n  }\n\n  protected function defineReturnType() {\n    return 'void';\n  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR-PERMISSIONS' => pht('Only admins can call this method.'),\n      'ERR-BAD-PHID' => pht('Non existent user PHID.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $actor = $request->getUser();\n    if (!$actor->getIsAdmin()) {\n      throw new ConduitException('ERR-PERMISSIONS');\n    }\n\n    $phids = $request->getValue('phids');\n\n    $users = id(new PhabricatorUser())->loadAllWhere(\n      'phid IN (%Ls)',\n      $phids);\n\n    if (count($phids) != count($users)) {\n      throw new ConduitException('ERR-BAD-PHID');\n    }\n\n    foreach ($phids as $phid) {\n      $params = array(\n        'transactions' => array(\n          array(\n            'type' => 'disabled',\n            'value' => true,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/people/conduit/UserDisableConduitAPIMethod.php#L23-L59","documentation":"Conduit error code for user.disable: the calling user is not a Phabricator administrator. The method mutates other users' accounts, so the very first check in execute() rejects non-admin callers with this code before any phids are examined.","triggerScenarios":"Thrown at src/applications/people/conduit/UserDisableConduitAPIMethod.php:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Authenticate to conduit with an administrator account","Grant the calling user administrator rights if appropriate"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}