Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14377883
D7306.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Referenced Files
None
Subscribers
None
D7306.diff
View Options
Index: src/applications/conduit/method/ConduitAPIMethod.php
===================================================================
--- src/applications/conduit/method/ConduitAPIMethod.php
+++ src/applications/conduit/method/ConduitAPIMethod.php
@@ -25,7 +25,7 @@
/**
* This is mostly for compatibility with
- * @{class:AphrontCursorPagedPolicyAwareQuery}.
+ * @{class:PhabricatorCursorPagedPolicyAwareQuery}.
*/
public function getID() {
return $this->getAPIMethodName();
@@ -166,6 +166,10 @@
/* -( PhabricatorPolicyInterface )----------------------------------------- */
+ public function getPHID() {
+ return null;
+ }
+
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
Index: src/applications/config/storage/PhabricatorConfigEntry.php
===================================================================
--- src/applications/config/storage/PhabricatorConfigEntry.php
+++ src/applications/config/storage/PhabricatorConfigEntry.php
@@ -3,8 +3,6 @@
final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $namespace;
protected $configKey;
protected $value;
Index: src/applications/conpherence/storage/ConpherenceThread.php
===================================================================
--- src/applications/conpherence/storage/ConpherenceThread.php
+++ src/applications/conpherence/storage/ConpherenceThread.php
@@ -6,8 +6,6 @@
final class ConpherenceThread extends ConpherenceDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $title;
protected $messageCount;
protected $recentParticipantPHIDs = array();
Index: src/applications/countdown/storage/PhabricatorCountdown.php
===================================================================
--- src/applications/countdown/storage/PhabricatorCountdown.php
+++ src/applications/countdown/storage/PhabricatorCountdown.php
@@ -7,8 +7,6 @@
extends PhabricatorCountdownDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
protected $title;
protected $authorPHID;
protected $epoch;
Index: src/applications/daemon/storage/PhabricatorDaemonLog.php
===================================================================
--- src/applications/daemon/storage/PhabricatorDaemonLog.php
+++ src/applications/daemon/storage/PhabricatorDaemonLog.php
@@ -26,6 +26,9 @@
/* -( PhabricatorPolicyInterface )----------------------------------------- */
+ public function getPHID() {
+ return null;
+ }
public function getCapabilities() {
return array(
Index: src/applications/differential/storage/DifferentialRevision.php
===================================================================
--- src/applications/differential/storage/DifferentialRevision.php
+++ src/applications/differential/storage/DifferentialRevision.php
@@ -13,7 +13,6 @@
protected $summary = '';
protected $testPlan = '';
- protected $phid;
protected $authorPHID;
protected $lastReviewerPHID;
Index: src/applications/diviner/storage/DivinerLiveBook.php
===================================================================
--- src/applications/diviner/storage/DivinerLiveBook.php
+++ src/applications/diviner/storage/DivinerLiveBook.php
@@ -3,7 +3,6 @@
final class DivinerLiveBook extends DivinerDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $name;
protected $viewPolicy;
protected $configurationData = array();
Index: src/applications/diviner/storage/DivinerLiveSymbol.php
===================================================================
--- src/applications/diviner/storage/DivinerLiveSymbol.php
+++ src/applications/diviner/storage/DivinerLiveSymbol.php
@@ -3,7 +3,6 @@
final class DivinerLiveSymbol extends DivinerDAO
implements PhabricatorPolicyInterface, PhabricatorMarkupInterface {
- protected $phid;
protected $bookPHID;
protected $context;
protected $type;
Index: src/applications/feed/story/PhabricatorFeedStory.php
===================================================================
--- src/applications/feed/story/PhabricatorFeedStory.php
+++ src/applications/feed/story/PhabricatorFeedStory.php
@@ -283,6 +283,9 @@
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */
+ public function getPHID() {
+ return null;
+ }
/**
* @task policy
Index: src/applications/files/storage/PhabricatorFile.php
===================================================================
--- src/applications/files/storage/PhabricatorFile.php
+++ src/applications/files/storage/PhabricatorFile.php
@@ -14,7 +14,6 @@
const METADATA_IMAGE_WIDTH = 'width';
const METADATA_IMAGE_HEIGHT = 'height';
- protected $phid;
protected $name;
protected $mimeType;
protected $byteSize;
Index: src/applications/herald/storage/transcript/HeraldTranscript.php
===================================================================
--- src/applications/herald/storage/transcript/HeraldTranscript.php
+++ src/applications/herald/storage/transcript/HeraldTranscript.php
@@ -3,9 +3,6 @@
final class HeraldTranscript extends HeraldDAO
implements PhabricatorPolicyInterface {
- protected $id;
- protected $phid;
-
protected $objectTranscript;
protected $ruleTranscripts = array();
protected $conditionTranscripts = array();
Index: src/applications/legalpad/storage/LegalpadDocument.php
===================================================================
--- src/applications/legalpad/storage/LegalpadDocument.php
+++ src/applications/legalpad/storage/LegalpadDocument.php
@@ -9,7 +9,6 @@
PhabricatorSubscribableInterface,
PhabricatorApplicationTransactionInterface {
- protected $phid;
protected $title;
protected $contributorCount;
protected $recentContributorPHIDs = array();
Index: src/applications/macro/storage/PhabricatorFileImageMacro.php
===================================================================
--- src/applications/macro/storage/PhabricatorFileImageMacro.php
+++ src/applications/macro/storage/PhabricatorFileImageMacro.php
@@ -8,7 +8,6 @@
protected $authorPHID;
protected $filePHID;
- protected $phid;
protected $name;
protected $isDisabled = 0;
protected $audioPHID;
Index: src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
===================================================================
--- src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
+++ src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
@@ -4,7 +4,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $email;
protected $uri;
Index: src/applications/maniphest/storage/ManiphestTask.php
===================================================================
--- src/applications/maniphest/storage/ManiphestTask.php
+++ src/applications/maniphest/storage/ManiphestTask.php
@@ -10,7 +10,6 @@
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
- protected $phid;
protected $authorPHID;
protected $ownerPHID;
protected $ccPHIDs = array();
Index: src/applications/owners/storage/PhabricatorOwnersPackage.php
===================================================================
--- src/applications/owners/storage/PhabricatorOwnersPackage.php
+++ src/applications/owners/storage/PhabricatorOwnersPackage.php
@@ -3,7 +3,6 @@
final class PhabricatorOwnersPackage extends PhabricatorOwnersDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $name;
protected $originalName;
protected $auditingEnabled;
Index: src/applications/paste/storage/PhabricatorPaste.php
===================================================================
--- src/applications/paste/storage/PhabricatorPaste.php
+++ src/applications/paste/storage/PhabricatorPaste.php
@@ -9,7 +9,6 @@
PhabricatorTokenReceiverInterface,
PhabricatorPolicyInterface {
- protected $phid;
protected $title;
protected $authorPHID;
protected $filePHID;
Index: src/applications/people/storage/PhabricatorUser.php
===================================================================
--- src/applications/people/storage/PhabricatorUser.php
+++ src/applications/people/storage/PhabricatorUser.php
@@ -11,7 +11,6 @@
const NAMETOKEN_TABLE = 'user_nametoken';
const MAXIMUM_USERNAME_LENGTH = 64;
- protected $phid;
protected $userName;
protected $realName;
protected $sex;
Index: src/applications/phame/storage/PhameBlog.php
===================================================================
--- src/applications/phame/storage/PhameBlog.php
+++ src/applications/phame/storage/PhameBlog.php
@@ -10,8 +10,6 @@
const SKIN_DEFAULT = 'oblivious';
- protected $id;
- protected $phid;
protected $name;
protected $description;
protected $domain;
Index: src/applications/phame/storage/PhamePost.php
===================================================================
--- src/applications/phame/storage/PhamePost.php
+++ src/applications/phame/storage/PhamePost.php
@@ -15,8 +15,6 @@
const VISIBILITY_DRAFT = 0;
const VISIBILITY_PUBLISHED = 1;
- protected $id;
- protected $phid;
protected $bloggerPHID;
protected $title;
protected $phameTitle;
Index: src/applications/phriction/storage/PhrictionDocument.php
===================================================================
--- src/applications/phriction/storage/PhrictionDocument.php
+++ src/applications/phriction/storage/PhrictionDocument.php
@@ -9,8 +9,6 @@
PhabricatorSubscribableInterface,
PhabricatorTokenReceiverInterface {
- protected $id;
- protected $phid;
protected $slug;
protected $depth;
protected $contentID;
Index: src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
===================================================================
--- src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
+++ src/applications/policy/__tests__/PhabricatorPolicyTestObject.php
@@ -10,6 +10,10 @@
private $policies = array();
private $automaticCapabilities = array();
+ public function getPHID() {
+ return null;
+ }
+
public function getCapabilities() {
return $this->capabilities;
}
Index: src/applications/policy/filter/PhabricatorPolicyFilter.php
===================================================================
--- src/applications/policy/filter/PhabricatorPolicyFilter.php
+++ src/applications/policy/filter/PhabricatorPolicyFilter.php
@@ -282,19 +282,9 @@
$details = array_filter(array_merge(array($more), (array)$exceptions));
- // NOTE: Not every policy object has a PHID, just pull an arbitrary
- // "unknown object" handle if this fails. We're just using this to provide
- // a better error message if we can.
-
- $phid = '?';
- if (($object instanceof PhabricatorLiskDAO) ||
- (method_exists($object, 'getPHID'))) {
- try {
- $phid = $object->getPHID();
- } catch (Exception $ignored) {
- // Ignore.
- }
- }
+ // NOTE: Not every type of policy object has a real PHID; just load an
+ // empty handle if a real PHID isn't available.
+ $phid = nonempty($object->getPHID(), PhabricatorPHIDConstants::PHID_VOID);
$handle = id(new PhabricatorHandleQuery())
->setViewer($this->viewer)
Index: src/applications/policy/interface/PhabricatorPolicyInterface.php
===================================================================
--- src/applications/policy/interface/PhabricatorPolicyInterface.php
+++ src/applications/policy/interface/PhabricatorPolicyInterface.php
@@ -2,6 +2,7 @@
interface PhabricatorPolicyInterface {
+ public function getPHID();
public function getCapabilities();
public function getPolicy($capability);
public function hasAutomaticCapability($capability, PhabricatorUser $viewer);
Index: src/applications/project/storage/PhabricatorProject.php
===================================================================
--- src/applications/project/storage/PhabricatorProject.php
+++ src/applications/project/storage/PhabricatorProject.php
@@ -4,7 +4,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
protected $authorPHID;
protected $subprojectPHIDs = array();
Index: src/applications/releeph/storage/ReleephBranch.php
===================================================================
--- src/applications/releeph/storage/ReleephBranch.php
+++ src/applications/releeph/storage/ReleephBranch.php
@@ -3,7 +3,6 @@
final class ReleephBranch extends ReleephDAO
implements PhabricatorPolicyInterface {
- protected $phid;
protected $releephProjectID;
protected $isActive;
protected $createdByUserPHID;
Index: src/applications/releeph/storage/ReleephProject.php
===================================================================
--- src/applications/releeph/storage/ReleephProject.php
+++ src/applications/releeph/storage/ReleephProject.php
@@ -10,7 +10,6 @@
const COMMIT_AUTHOR_FROM_DIFF = 'commit-author-is-from-diff';
const COMMIT_AUTHOR_REQUESTOR = 'commit-author-is-requestor';
- protected $phid;
protected $name;
// Specifying the place to pick from is a requirement for svn, though not
Index: src/applications/releeph/storage/ReleephRequest.php
===================================================================
--- src/applications/releeph/storage/ReleephRequest.php
+++ src/applications/releeph/storage/ReleephRequest.php
@@ -5,7 +5,6 @@
PhabricatorPolicyInterface,
PhabricatorCustomFieldInterface {
- protected $phid;
protected $branchID;
protected $requestUserPHID;
protected $details = array();
Index: src/applications/repository/storage/PhabricatorRepository.php
===================================================================
--- src/applications/repository/storage/PhabricatorRepository.php
+++ src/applications/repository/storage/PhabricatorRepository.php
@@ -25,7 +25,6 @@
const TABLE_BADCOMMIT = 'repository_badcommit';
const TABLE_LINTMESSAGE = 'repository_lintmessage';
- protected $phid;
protected $name;
protected $callsign;
protected $uuid;
Index: src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
===================================================================
--- src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
+++ src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
@@ -8,7 +8,6 @@
implements PhabricatorPolicyInterface {
protected $name;
- protected $phid;
protected $repositoryID;
protected $symbolIndexLanguages = array();
Index: src/infrastructure/storage/lisk/LiskDAO.php
===================================================================
--- src/infrastructure/storage/lisk/LiskDAO.php
+++ src/infrastructure/storage/lisk/LiskDAO.php
@@ -892,6 +892,11 @@
}
+ public function getPHID() {
+ return $this->phid;
+ }
+
+
/**
* Test if a property exists.
*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 1:48 AM (20 h, 18 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6916949
Default Alt Text
D7306.diff (14 KB)
Attached To
Mode
D7306: Make PhabricatorPolicyInterface require a getPHID() method
Attached
Detach File
Event Timeline
Log In to Comment