Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896618
AlmanacServiceEditor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
AlmanacServiceEditor.php
View Options
<?php
final
class
AlmanacServiceEditor
extends
AlmanacEditor
{
public
function
getEditorObjectsDescription
(
)
{
return
pht
(
'Almanac Service'
)
;
}
public
function
getCreateObjectTitle
(
$author
,
$object
)
{
return
pht
(
'%s created this service.'
,
$author
)
;
}
public
function
getCreateObjectTitleForFeed
(
$author
,
$object
)
{
return
pht
(
'%s created %s.'
,
$author
,
$object
)
;
}
public
function
getTransactionTypes
(
)
{
$types
=
parent
::
getTransactionTypes
(
)
;
$types
[
]
=
PhabricatorTransactions
::
TYPE_VIEW_POLICY
;
$types
[
]
=
PhabricatorTransactions
::
TYPE_EDIT_POLICY
;
return
$types
;
}
protected
function
validateAllTransactions
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
$errors
=
parent
::
validateAllTransactions
(
$object
,
$xactions
)
;
if
(
$object
->
isClusterService
(
)
)
{
$can_manage
=
PhabricatorPolicyFilter
::
hasCapability
(
$this
->
getActor
(
)
,
new
PhabricatorAlmanacApplication
(
)
,
AlmanacManageClusterServicesCapability
::
CAPABILITY
)
;
if
(
!
$can_manage
)
{
$errors
[
]
=
new
PhabricatorApplicationTransactionValidationError
(
null
,
pht
(
'Restricted'
)
,
pht
(
'You do not have permission to manage cluster services.'
)
,
null
)
;
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 23:20 (6 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129835
Default Alt Text
AlmanacServiceEditor.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment