3 final class PhabricatorPolicySearchEngineExtension
4 extends PhabricatorSearchEngineExtension
{
6 const EXTENSIONKEY
= 'policy';
8 public function isExtensionEnabled() {
12 public function getExtensionName() {
13 return pht('Support for Policies');
16 public function supportsObject($object) {
17 return ($object instanceof PhabricatorPolicyInterface
);
20 public function getExtensionOrder() {
24 public function getFieldSpecificationsForConduit($object) {
26 id(new PhabricatorConduitSearchFieldSpecification())
28 ->setType('map<string, wild>')
29 ->setDescription(pht('Map of capabilities to current policies.')),
33 public function getFieldValuesForConduit($object, $data) {
34 $capabilities = $object->getCapabilities();
37 foreach ($capabilities as $capability) {
38 $map[$capability] = $object->getPolicy($capability);