Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1539377
DifferentialViewPolicyFieldSpecification.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
DifferentialViewPolicyFieldSpecification.php
View Options
<?php
final
class
DifferentialViewPolicyFieldSpecification
extends
DifferentialFieldSpecification
{
private
$value
;
public
function
shouldAppearOnEdit
()
{
return
true
;
}
protected
function
didSetRevision
()
{
$this
->
value
=
$this
->
getRevision
()->
getViewPolicy
();
}
public
function
setValueFromRequest
(
AphrontRequest
$request
)
{
$this
->
value
=
$request
->
getStr
(
'viewPolicy'
);
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_VIEW
)
->
setPolicyObject
(
$revision
)
->
setPolicies
(
$policies
)
->
setName
(
'viewPolicy'
);
}
public
function
willWriteRevision
(
DifferentialRevisionEditor
$editor
)
{
$this
->
getRevision
()->
setViewPolicy
(
$this
->
value
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 14, 11:51 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
350964
Default Alt Text
DifferentialViewPolicyFieldSpecification.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment