Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118872512
DifferentialEditPolicyFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 22, 16:33
Size
900 B
Mime Type
text/x-php
Expires
Tue, Jun 24, 16:33 (2 d)
Engine
blob
Format
Raw Data
Handle
26933753
Attached To
rPH Phabricator
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'
);
}
}
Event Timeline
Log In to Comment