3 final class UserDisableConduitAPIMethod
extends UserConduitAPIMethod
{
5 public function getAPIMethodName() {
9 public function getMethodDescription() {
10 return pht('Permanently disable specified users (admin only).');
13 public function getMethodStatus() {
14 return self
::METHOD_STATUS_DEPRECATED
;
17 public function getMethodStatusDescription() {
18 return pht('Obsoleted by method "user.edit".');
21 protected function defineParamTypes() {
23 'phids' => 'required list<phid>',
27 protected function defineReturnType() {
31 protected function defineErrorTypes() {
33 'ERR-PERMISSIONS' => pht('Only admins can call this method.'),
34 'ERR-BAD-PHID' => pht('Non existent user PHID.'),
38 protected function execute(ConduitAPIRequest
$request) {
39 $actor = $request->getUser();
40 if (!$actor->getIsAdmin()) {
41 throw new ConduitException('ERR-PERMISSIONS');
44 $phids = $request->getValue('phids');
46 $users = id(new PhabricatorUser())->loadAllWhere(
50 if (count($phids) != count($users)) {
51 throw new ConduitException('ERR-BAD-PHID');
54 foreach ($phids as $phid) {
56 'transactions' => array(
62 'objectIdentifier' => $phid,
65 id(new ConduitCall('user.edit', $params))