Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1943
Edit Engine Extension
Active
Public
Actions
Authored by
yelirekim
on Feb 15 2016, 3:50 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F1112713: Edit Engine Extension
Feb 15 2016, 3:50 PM
2016-02-15 15:50:52 (UTC+0)
Subscribers
None
<?php
final
class
CIEnforcementEngineExtension
extends
PhabricatorEditEngineExtension
{
const
EXTENSIONKEY
=
'enforcement.owners'
;
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Enforcement Policies'
);
}
public
function
supportsObject
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
return
$engine
instanceof
PhabricatorOwnersPackageEditEngine
&&
$object
instanceof
PhabricatorOwnersPackage
;
}
public
function
buildCustomEditFields
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
return
[
id
(
new
PhabricatorDatasourceEditField
())
->
setKey
(
'owners'
)
->
setLabel
(
pht
(
'Enforced Owners'
))
->
setDescription
(
pht
(
'Users and projects which own the package.'
))
->
setIsLocked
(
true
)
->
setTransactionType
(
PhabricatorOwnersPackageTransaction
::
TYPE_OWNERS
)
->
setDatasource
(
new
PhabricatorProjectOrUserDatasource
())
->
setIsCopyable
(
true
)
->
setValue
(
$object
->
getOwnerPHIDs
()),
];
}
}
Event Timeline
yelirekim
created this paste.
Feb 15 2016, 3:50 PM
2016-02-15 15:50:52 (UTC+0)
yelirekim
mentioned this in
Q311: How dangerous is this edit engine extension?
.
Feb 15 2016, 3:53 PM
2016-02-15 15:53:42 (UTC+0)
Log In to Comment