Changeset View
Changeset View
Standalone View
Standalone View
src/applications/base/PhabricatorApplication.php
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | /* -( Application Information )-------------------------------------------- */ | ||||
* @return bool True if this application should be pinned by default. | * @return bool True if this application should be pinned by default. | ||||
*/ | */ | ||||
public function isPinnedByDefault(PhabricatorUser $viewer) { | public function isPinnedByDefault(PhabricatorUser $viewer) { | ||||
return false; | return false; | ||||
} | } | ||||
/** | /** | ||||
* Returns true if an application is first-party (developed by Phacility) | * Returns true if an application is first-party and false otherwise. | ||||
* and false otherwise. | |||||
* | * | ||||
* @return bool True if this application is developed by Phacility. | * @return bool True if this application is first-party. | ||||
*/ | */ | ||||
final public function isFirstParty() { | final public function isFirstParty() { | ||||
$where = id(new ReflectionClass($this))->getFileName(); | $where = id(new ReflectionClass($this))->getFileName(); | ||||
$root = phutil_get_library_root('phabricator'); | $root = phutil_get_library_root('phabricator'); | ||||
if (!Filesystem::isDescendant($where, $root)) { | if (!Filesystem::isDescendant($where, $root)) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | final public function isCapabilityEditable($capability) { | ||||
} | } | ||||
} | } | ||||
final public function getCapabilityCaption($capability) { | final public function getCapabilityCaption($capability) { | ||||
switch ($capability) { | switch ($capability) { | ||||
case PhabricatorPolicyCapability::CAN_VIEW: | case PhabricatorPolicyCapability::CAN_VIEW: | ||||
if (!$this->canUninstall()) { | if (!$this->canUninstall()) { | ||||
return pht( | return pht( | ||||
'This application is required for Phabricator to operate, so all '. | 'This application is required, so all '. | ||||
'users must have access to it.'); | 'users must have access to it.'); | ||||
} else { | } else { | ||||
return null; | return null; | ||||
} | } | ||||
case PhabricatorPolicyCapability::CAN_EDIT: | case PhabricatorPolicyCapability::CAN_EDIT: | ||||
return null; | return null; | ||||
default: | default: | ||||
$spec = $this->getCustomCapabilitySpecification($capability); | $spec = $this->getCustomCapabilitySpecification($capability); | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0