Differential D19915 Diff 47537 src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php
| Show All 39 Lines | foreach ($xactions as $xaction) { | ||||
| } | } | ||||
| if ($user->getPHID() === $actor->getPHID()) { | if ($user->getPHID() === $actor->getPHID()) { | ||||
| $errors[] = $this->newInvalidError( | $errors[] = $this->newInvalidError( | ||||
| pht('After a time, your efforts fail. You can not adjust your own '. | pht('After a time, your efforts fail. You can not adjust your own '. | ||||
| 'status as an administrator.'), $xaction); | 'status as an administrator.'), $xaction); | ||||
| } | } | ||||
| if (!$actor->getIsAdmin()) { | $is_admin = $actor->getIsAdmin(); | ||||
| $is_omnipotent = $actor->isOmnipotent(); | |||||
amckinley: I'm not wild about this change; is there a better way? | |||||
| if (!$is_admin && !$is_omnipotent) { | |||||
| $errors[] = $this->newInvalidError( | $errors[] = $this->newInvalidError( | ||||
| pht('You must be an administrator to create administrators.'), | pht('You must be an administrator to create administrators.'), | ||||
| $xaction); | $xaction); | ||||
| } | } | ||||
| } | } | ||||
| return $errors; | return $errors; | ||||
| } | } | ||||
| Show All 39 Lines | |||||
I'm not wild about this change; is there a better way?