Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99432052
PhabricatorPolicySearchEngineExtension.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
Fri, Jan 24, 12:44
Size
996 B
Mime Type
text/x-php
Expires
Sun, Jan 26, 12:44 (2 d)
Engine
blob
Format
Raw Data
Handle
23799552
Attached To
rPH Phabricator
PhabricatorPolicySearchEngineExtension.php
View Options
<?php
final
class
PhabricatorPolicySearchEngineExtension
extends
PhabricatorSearchEngineExtension
{
const
EXTENSIONKEY
=
'policy'
;
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Support for Policies'
);
}
public
function
supportsObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorPolicyInterface
);
}
public
function
getExtensionOrder
()
{
return
6000
;
}
public
function
getFieldSpecificationsForConduit
(
$object
)
{
return
array
(
'policy'
=>
array
(
'type'
=>
'map<string, wild>'
,
'description'
=>
pht
(
'Map of capabilities to current policies.'
),
),
);
}
public
function
getFieldValuesForConduit
(
$object
)
{
$capabilities
=
$object
->
getCapabilities
();
$map
=
array
();
foreach
(
$capabilities
as
$capability
)
{
$map
[
$capability
]
=
$object
->
getPolicy
(
$capability
);
}
return
array
(
'policy'
=>
$map
,
);
}
}
Event Timeline
Log In to Comment