Differential D17228 Diff 41437 src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | return $this->getProfileObject()->hasAutomaticCapability( | ||||
$viewer); | $viewer); | ||||
} | } | ||||
/* -( PhabricatorExtendedPolicyInterface )--------------------------------- */ | /* -( PhabricatorExtendedPolicyInterface )--------------------------------- */ | ||||
public function getExtendedPolicy($capability, PhabricatorUser $viewer) { | public function getExtendedPolicy($capability, PhabricatorUser $viewer) { | ||||
// If this is an item with a custom PHID (like a personal menu item), | |||||
// we only require that the user can edit the corresponding custom | |||||
// object (usually their own user profile), not the object that the | |||||
// menu appears on (which may be an Application like Favorites or Home). | |||||
if ($capability == PhabricatorPolicyCapability::CAN_EDIT) { | |||||
if ($this->getCustomPHID()) { | |||||
return array( | |||||
array( | |||||
$this->getCustomPHID(), | |||||
$capability, | |||||
), | |||||
); | |||||
} | |||||
} | |||||
return array( | return array( | ||||
array( | array( | ||||
$this->getProfileObject(), | $this->getProfileObject(), | ||||
$capability, | $capability, | ||||
), | ), | ||||
); | ); | ||||
} | } | ||||
Show All 24 Lines |