phacility/phabricator · error · ConduitException

ERR-PERMISSIONS

ERR-PERMISSIONS

Error message

Only admins can call this method.

What it means

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.

Solutions

  1. Authenticate to conduit with an administrator account
  2. Grant the calling user administrator rights if appropriate
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/people/conduit/UserDisableConduitAPIMethod.php:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/0e6cb265c996fdd9. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/people/conduit/UserDisableConduitAPIMethod.php:41

      'phids' => 'required list<phid>',
    );
  }

  protected function defineReturnType() {
    return 'void';
  }

  protected function defineErrorTypes() {
    return array(
      'ERR-PERMISSIONS' => pht('Only admins can call this method.'),
      'ERR-BAD-PHID' => pht('Non existent user PHID.'),
    );
  }

  protected function execute(ConduitAPIRequest $request) {
    $actor = $request->getUser();
    if (!$actor->getIsAdmin()) {
      throw new ConduitException('ERR-PERMISSIONS');
    }

    $phids = $request->getValue('phids');

    $users = id(new PhabricatorUser())->loadAllWhere(
      'phid IN (%Ls)',
      $phids);

    if (count($phids) != count($users)) {
      throw new ConduitException('ERR-BAD-PHID');
    }

    foreach ($phids as $phid) {
      $params = array(
        'transactions' => array(
          array(
            'type' => 'disabled',
            'value' => true,

View on GitHub (pinned to 5720a38cfe)