Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1533832
DifferentialEditPolicyFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DifferentialEditPolicyFieldSpecification.php
View Options
<?php
final
class
DifferentialEditPolicyFieldSpecification
extends
DifferentialFieldSpecification
{
private
$value
;
public
function
shouldAppearOnEdit
()
{
return
true
;
}
protected
function
didSetRevision
()
{
$this
->
value
=
$this
->
getRevision
()->
getEditPolicy
();
}
public
function
setValueFromRequest
(
AphrontRequest
$request
)
{
$this
->
value
=
$request
->
getStr
(
'editPolicy'
);
return
$this
;
}
public
function
renderEditControl
()
{
$viewer
=
$this
->
getUser
();
$revision
=
$this
->
getRevision
();
$policies
=
id
(
new
PhabricatorPolicyQuery
())
->
setViewer
(
$viewer
)
->
setObject
(
$revision
)
->
execute
();
return
id
(
new
AphrontFormPolicyControl
())
->
setUser
(
$viewer
)
->
setCapability
(
PhabricatorPolicyCapability
::
CAN_EDIT
)
->
setPolicyObject
(
$revision
)
->
setPolicies
(
$policies
)
->
setName
(
'editPolicy'
)
->
setCaption
(
pht
(
'NOTE: These policy features are not yet fully supported.'
));
}
public
function
willWriteRevision
(
DifferentialRevisionEditor
$editor
)
{
$this
->
getRevision
()->
setEditPolicy
(
$this
->
value
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 14, 8:02 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
352903
Default Alt Text
DifferentialEditPolicyFieldSpecification.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment