Changeset View
Changeset View
Standalone View
Standalone View
src/applications/base/PhabricatorApplication.php
<?php | <?php | ||||
/** | /** | ||||
* @task info Application Information | * @task info Application Information | ||||
* @task ui UI Integration | * @task ui UI Integration | ||||
* @task uri URI Routing | * @task uri URI Routing | ||||
* @task mail Email integration | * @task mail Email integration | ||||
* @task fact Fact Integration | * @task fact Fact Integration | ||||
* @task meta Application Management | * @task meta Application Management | ||||
*/ | */ | ||||
abstract class PhabricatorApplication | abstract class PhabricatorApplication | ||||
extends PhabricatorLiskDAO | extends PhabricatorLiskDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorApplicationTransactionInterface { | PhabricatorApplicationTransactionInterface { | ||||
const GROUP_CORE = 'core'; | const GROUP_CORE = 'core'; | ||||
speck: Before I get too much further on this I think this may actually need to be defined in Arcanist… | |||||
Not Done Inline ActionsThen maybe it is best to make this a function? This way where it points can be changed later on. deadalnix: Then maybe it is best to make this a function? This way where it points can be changed later on. | |||||
Done Inline ActionsYea I think turning this into a function will be better speck: Yea I think turning this into a function will be better | |||||
const GROUP_UTILITIES = 'util'; | const GROUP_UTILITIES = 'util'; | ||||
const GROUP_ADMIN = 'admin'; | const GROUP_ADMIN = 'admin'; | ||||
const GROUP_DEVELOPER = 'developer'; | const GROUP_DEVELOPER = 'developer'; | ||||
final public static function getApplicationGroups() { | final public static function getApplicationGroups() { | ||||
return array( | return array( | ||||
self::GROUP_CORE => pht('Core Applications'), | self::GROUP_CORE => pht('Core Applications'), | ||||
self::GROUP_UTILITIES => pht('Utilities'), | self::GROUP_UTILITIES => pht('Utilities'), | ||||
▲ Show 20 Lines • Show All 526 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 for %s to operate, so all '. | ||||
'users must have access to it.'); | 'users must have access to it.', | ||||
PhabricatorPlatformSite::getName()); | |||||
} 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); | ||||
return idx($spec, 'caption'); | return idx($spec, 'caption'); | ||||
▲ Show 20 Lines • Show All 87 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
Before I get too much further on this I think this may actually need to be defined in Arcanist and not here. I’m sure Arcanist has loads of hardcoded “Phabricator” as well and it would be better to have it defined in a single place.