3 final class PhabricatorUserRolesField
4 extends PhabricatorUserCustomField
{
8 public function getFieldKey() {
12 public function getFieldName() {
16 public function getFieldDescription() {
17 return pht('Shows roles like "Administrator" and "Disabled".');
20 public function shouldAppearInPropertyView() {
24 public function renderPropertyViewValue(array $handles) {
25 $user = $this->getObject();
28 if ($user->getIsAdmin()) {
29 $roles[] = pht('Administrator');
31 if ($user->getIsDisabled()) {
32 $roles[] = pht('Disabled');
34 if (!$user->getIsApproved()) {
35 $roles[] = pht('Not Approved');
37 if ($user->getIsSystemAgent()) {
38 $roles[] = pht('Bot');
40 if ($user->getIsMailingList()) {
41 $roles[] = pht('Mailing List');
45 return implode(', ', $roles);