Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F457915
PhabricatorUserRolesField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
828 B
Referenced Files
None
Subscribers
None
PhabricatorUserRolesField.php
View Options
<?php
final
class
PhabricatorUserRolesField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:roles'
;
}
public
function
getFieldName
()
{
return
pht
(
'Roles'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Shows roles like "Administrator" and "Disabled".'
);
}
public
function
shouldAppearInPropertyView
()
{
return
true
;
}
public
function
renderPropertyViewValue
()
{
$user
=
$this
->
getObject
();
$roles
=
array
();
if
(
$user
->
getIsAdmin
())
{
$roles
[]
=
pht
(
'Administrator'
);
}
if
(
$user
->
getIsDisabled
())
{
$roles
[]
=
pht
(
'Disabled'
);
}
if
(
$user
->
getIsSystemAgent
())
{
$roles
[]
=
pht
(
'Bot'
);
}
if
(
$roles
)
{
return
implode
(
', '
,
$roles
);
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 10:36 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71117
Default Alt Text
PhabricatorUserRolesField.php (828 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment