[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorRepositoryAuditRequest 4 extends PhabricatorRepositoryDAO 5 implements PhabricatorPolicyInterface { 6 7 protected $auditorPHID; 8 protected $commitPHID; 9 protected $auditReasons = array(); 10 protected $auditStatus; 11 12 private $commit = self::ATTACHABLE; 13 14 public function getConfiguration() { 15 return array( 16 self::CONFIG_TIMESTAMPS => false, 17 self::CONFIG_SERIALIZATION => array( 18 'auditReasons' => self::SERIALIZATION_JSON, 19 ), 20 self::CONFIG_COLUMN_SCHEMA => array( 21 'auditStatus' => 'text64', 22 ), 23 self::CONFIG_KEY_SCHEMA => array( 24 'commitPHID' => array( 25 'columns' => array('commitPHID'), 26 ), 27 'auditorPHID' => array( 28 'columns' => array('auditorPHID', 'auditStatus'), 29 ), 30 'key_unique' => array( 31 'columns' => array('commitPHID', 'auditorPHID'), 32 'unique' => true, 33 ), 34 ), 35 ) + parent::getConfiguration(); 36 } 37 38 public function isUser() { 39 $user_type = PhabricatorPeopleUserPHIDType::TYPECONST; 40 return (phid_get_type($this->getAuditorPHID()) == $user_type); 41 } 42 43 public function attachCommit(PhabricatorRepositoryCommit $commit) { 44 $this->commit = $commit; 45 return $this; 46 } 47 48 public function getCommit() { 49 return $this->assertAttached($this->commit); 50 } 51 52 53 /* -( PhabricatorPolicyInterface )----------------------------------------- */ 54 55 56 public function getCapabilities() { 57 return array( 58 PhabricatorPolicyCapability::CAN_VIEW, 59 ); 60 } 61 62 public function getPolicy($capability) { 63 return $this->getCommit()->getPolicy($capability); 64 } 65 66 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 67 return $this->getCommit()->hasAutomaticCapability($capability, $viewer); 68 } 69 70 public function describeAutomaticCapability($capability) { 71 return pht( 72 'This audit is attached to a commit, and inherits its policies.'); 73 } 74 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |