Page MenuHomePhabricator

D7838.id17750.diff
No OneTemporary

D7838.id17750.diff

Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ src/__phutil_library_map__.php
@@ -1560,6 +1560,7 @@
'PhabricatorMainMenuIconView' => 'view/page/menu/PhabricatorMainMenuIconView.php',
'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php',
'PhabricatorMainMenuView' => 'view/page/menu/PhabricatorMainMenuView.php',
+ 'PhabricatorManagementWorkflow' => 'infrastructure/management/PhabricatorManagementWorkflow.php',
'PhabricatorManiphestConfigOptions' => 'applications/maniphest/config/PhabricatorManiphestConfigOptions.php',
'PhabricatorManiphestTaskTestDataGenerator' => 'applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php',
'PhabricatorMarkupCache' => 'applications/cache/storage/PhabricatorMarkupCache.php',
@@ -3020,7 +3021,7 @@
'DivinerReturnTableView' => 'AphrontTagView',
'DivinerSectionView' => 'AphrontTagView',
'DivinerStaticPublisher' => 'DivinerPublisher',
- 'DivinerWorkflow' => 'PhutilArgumentWorkflow',
+ 'DivinerWorkflow' => 'PhabricatorManagementWorkflow',
'DoorkeeperBridge' => 'Phobject',
'DoorkeeperBridgeAsana' => 'DoorkeeperBridge',
'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge',
@@ -3099,7 +3100,7 @@
'DrydockManagementCreateResourceWorkflow' => 'DrydockManagementWorkflow',
'DrydockManagementLeaseWorkflow' => 'DrydockManagementWorkflow',
'DrydockManagementReleaseWorkflow' => 'DrydockManagementWorkflow',
- 'DrydockManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'DrydockManagementWorkflow' => 'PhabricatorManagementWorkflow',
'DrydockPHIDTypeBlueprint' => 'PhabricatorPHIDType',
'DrydockPHIDTypeLease' => 'PhabricatorPHIDType',
'DrydockPHIDTypeResource' => 'PhabricatorPHIDType',
@@ -3197,7 +3198,7 @@
'HarbormasterDAO' => 'PhabricatorLiskDAO',
'HarbormasterHTTPRequestBuildStepImplementation' => 'VariableBuildStepImplementation',
'HarbormasterManagementBuildWorkflow' => 'HarbormasterManagementWorkflow',
- 'HarbormasterManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow',
'HarbormasterObject' => 'HarbormasterDAO',
'HarbormasterPHIDTypeBuild' => 'PhabricatorPHIDType',
'HarbormasterPHIDTypeBuildItem' => 'PhabricatorPHIDType',
@@ -3672,7 +3673,7 @@
'PhabricatorAuditListView' => 'AphrontView',
'PhabricatorAuditMailReceiver' => 'PhabricatorObjectMailReceiver',
'PhabricatorAuditManagementDeleteWorkflow' => 'PhabricatorAuditManagementWorkflow',
- 'PhabricatorAuditManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorAuditManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorAuditPreviewController' => 'PhabricatorAuditController',
'PhabricatorAuditReplyHandler' => 'PhabricatorMailReplyHandler',
'PhabricatorAuthAccountView' => 'AphrontView',
@@ -3687,7 +3688,7 @@
'PhabricatorAuthManagementLDAPWorkflow' => 'PhabricatorAuthManagementWorkflow',
'PhabricatorAuthManagementRecoverWorkflow' => 'PhabricatorAuthManagementWorkflow',
'PhabricatorAuthManagementRefreshWorkflow' => 'PhabricatorAuthManagementWorkflow',
- 'PhabricatorAuthManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorAuthManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorAuthNeedsApprovalController' => 'PhabricatorAuthController',
'PhabricatorAuthNewController' => 'PhabricatorAuthProviderConfigController',
'PhabricatorAuthOldOAuthRedirectController' => 'PhabricatorAuthController',
@@ -3740,7 +3741,7 @@
'PhabricatorBusyExample' => 'PhabricatorUIExample',
'PhabricatorCacheDAO' => 'PhabricatorLiskDAO',
'PhabricatorCacheManagementPurgeWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorCacheManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorCacheManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController',
'PhabricatorCalendarController' => 'PhabricatorController',
'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO',
@@ -3815,7 +3816,7 @@
'PhabricatorConfigManagementGetWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementListWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementSetWorkflow' => 'PhabricatorConfigManagementWorkflow',
- 'PhabricatorConfigManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorConfigManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorConfigOption' =>
array(
0 => 'Phobject',
@@ -3892,7 +3893,7 @@
'PhabricatorDaemonManagementStartWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementStatusWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementStopWorkflow' => 'PhabricatorDaemonManagementWorkflow',
- 'PhabricatorDaemonManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorDaemonManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorDataNotAttachedException' => 'Exception',
'PhabricatorDebugController' => 'PhabricatorController',
'PhabricatorDefaultFileStorageEngineSelector' => 'PhabricatorFileStorageEngineSelector',
@@ -3946,7 +3947,7 @@
'PhabricatorFactManagementDestroyWorkflow' => 'PhabricatorFactManagementWorkflow',
'PhabricatorFactManagementListWorkflow' => 'PhabricatorFactManagementWorkflow',
'PhabricatorFactManagementStatusWorkflow' => 'PhabricatorFactManagementWorkflow',
- 'PhabricatorFactManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFactManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFactRaw' => 'PhabricatorFactDAO',
'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec',
'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator',
@@ -3960,7 +3961,7 @@
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'PhabricatorFeedManagementRepublishWorkflow' => 'PhabricatorFeedManagementWorkflow',
- 'PhabricatorFeedManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFeedManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFeedPublicStreamController' => 'PhabricatorFeedController',
'PhabricatorFeedQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFeedSearchEngine' => 'PhabricatorApplicationSearchEngine',
@@ -4029,7 +4030,7 @@
'PhabricatorFilesManagementMigrateWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow',
- 'PhabricatorFilesManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFlag' =>
array(
0 => 'PhabricatorFlagDAO',
@@ -4077,7 +4078,7 @@
'PhabricatorLegalpadPHIDTypeDocument' => 'PhabricatorPHIDType',
'PhabricatorLintEngine' => 'PhutilLintEngine',
'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow',
- 'PhabricatorLipsumManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist',
'PhabricatorLiskDAO' => 'LiskDAO',
'PhabricatorLocalDiskFileStorageEngine' => 'PhabricatorFileStorageEngine',
@@ -4119,7 +4120,7 @@
'PhabricatorMailManagementSendTestWorkflow' => 'PhabricatorSearchManagementWorkflow',
'PhabricatorMailManagementShowInboundWorkflow' => 'PhabricatorSearchManagementWorkflow',
'PhabricatorMailManagementShowOutboundWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorMailManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorMailManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorMailReceiverTestCase' => 'PhabricatorTestCase',
'PhabricatorMailingListPHIDTypeList' => 'PhabricatorPHIDType',
'PhabricatorMailingListQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
@@ -4135,6 +4136,7 @@
'PhabricatorMainMenuIconView' => 'AphrontView',
'PhabricatorMainMenuSearchView' => 'AphrontView',
'PhabricatorMainMenuView' => 'AphrontView',
+ 'PhabricatorManagementWorkflow' => 'PhutilArgumentWorkflow',
'PhabricatorManiphestConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorManiphestTaskTestDataGenerator' => 'PhabricatorTestDataGenerator',
'PhabricatorMarkupCache' => 'PhabricatorCacheDAO',
@@ -4305,7 +4307,7 @@
'PhabricatorPolicyInterface' => 'PhabricatorPHIDInterface',
'PhabricatorPolicyManagementShowWorkflow' => 'PhabricatorPolicyManagementWorkflow',
'PhabricatorPolicyManagementUnlockWorkflow' => 'PhabricatorPolicyManagementWorkflow',
- 'PhabricatorPolicyManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorPolicyManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorPolicyPHIDTypePolicy' => 'PhabricatorPHIDType',
'PhabricatorPolicyQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorPolicyRuleAdministrators' => 'PhabricatorPolicyRule',
@@ -4421,7 +4423,7 @@
'PhabricatorRepositoryManagementLookupUsersWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementMarkImportedWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementPullWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
- 'PhabricatorRepositoryManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorRepositoryManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
'PhabricatorRepositoryMercurialCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
'PhabricatorRepositoryMirror' =>
@@ -4459,7 +4461,7 @@
'PhabricatorS3FileStorageEngine' => 'PhabricatorFileStorageEngine',
'PhabricatorSSHLog' => 'Phobject',
'PhabricatorSSHPassthruCommand' => 'Phobject',
- 'PhabricatorSSHWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorSSHWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSavedQuery' =>
array(
0 => 'PhabricatorSearchDAO',
@@ -4480,7 +4482,7 @@
'PhabricatorSearchEngineMySQL' => 'PhabricatorSearchEngine',
'PhabricatorSearchHovercardController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchManagementIndexWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorSearchManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorSearchManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSearchOrderController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchQuery' => 'PhabricatorSearchDAO',
'PhabricatorSearchResultView' => 'AphrontView',
@@ -4574,7 +4576,7 @@
'PhabricatorStorageManagementProbeWorkflow' => 'PhabricatorStorageManagementWorkflow',
'PhabricatorStorageManagementStatusWorkflow' => 'PhabricatorStorageManagementWorkflow',
'PhabricatorStorageManagementUpgradeWorkflow' => 'PhabricatorStorageManagementWorkflow',
- 'PhabricatorStorageManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorStorageManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSubscribersQuery' => 'PhabricatorQuery',
'PhabricatorSubscriptionsEditController' => 'PhabricatorController',
'PhabricatorSubscriptionsEditor' => 'PhabricatorEditor',
Index: src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
===================================================================
--- src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
+++ src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
@@ -178,10 +178,6 @@
return 0;
}
- private function getViewer() {
- return PhabricatorUser::getOmnipotentUser();
- }
-
private function loadUsers($users) {
$users = $this->parseList($users);
if (!$users) {
Index: src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
===================================================================
--- src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
+++ src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorAuditManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
===================================================================
--- src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
+++ src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$can_recover = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIsAdmin(true)
->execute();
if (!$can_recover) {
@@ -48,7 +48,7 @@
$username = head($usernames);
$user = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($username))
->executeOne();
Index: src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
===================================================================
--- src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
+++ src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
@@ -33,7 +33,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$query = id(new PhabricatorExternalAccountQuery())
->setViewer($viewer);
Index: src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
===================================================================
--- src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
+++ src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorAuthManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
===================================================================
--- src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
+++ src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorCacheManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/config/management/PhabricatorConfigManagementWorkflow.php
===================================================================
--- src/applications/config/management/PhabricatorConfigManagementWorkflow.php
+++ src/applications/config/management/PhabricatorConfigManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorConfigManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
===================================================================
--- src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
+++ src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
@@ -32,7 +32,7 @@
$id = head($id);
$daemon = id(new PhabricatorDaemonLogQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIDs(array($id))
->executeOne();
Index: src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
===================================================================
--- src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
+++ src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorDaemonManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function loadAvailableDaemonClasses() {
$loader = new PhutilSymbolLoader();
Index: src/applications/diviner/workflow/DivinerWorkflow.php
===================================================================
--- src/applications/diviner/workflow/DivinerWorkflow.php
+++ src/applications/diviner/workflow/DivinerWorkflow.php
@@ -1,6 +1,6 @@
<?php
-abstract class DivinerWorkflow extends PhutilArgumentWorkflow {
+abstract class DivinerWorkflow extends PhabricatorManagementWorkflow {
private $config;
private $bookConfigPath;
@@ -9,10 +9,6 @@
return $this->bookConfigPath;
}
- public function isExecutable() {
- return true;
- }
-
protected function getConfig($key, $default = null) {
return idx($this->config, $key, $default);
}
Index: src/applications/drydock/management/DrydockManagementCloseWorkflow.php
===================================================================
--- src/applications/drydock/management/DrydockManagementCloseWorkflow.php
+++ src/applications/drydock/management/DrydockManagementCloseWorkflow.php
@@ -25,7 +25,7 @@
"Specify one or more resource IDs to close.");
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$resources = id(new DrydockResourceQuery())
->setViewer($viewer)
Index: src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
===================================================================
--- src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
+++ src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
@@ -49,7 +49,7 @@
$attributes = $options->parse($attributes);
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$blueprint = id(new DrydockBlueprintQuery())
->setViewer($viewer)
Index: src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
===================================================================
--- src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
+++ src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
@@ -25,7 +25,7 @@
"Specify one or more lease IDs to release.");
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$leases = id(new DrydockLeaseQuery())
->setViewer($viewer)
Index: src/applications/drydock/management/DrydockManagementWorkflow.php
===================================================================
--- src/applications/drydock/management/DrydockManagementWorkflow.php
+++ src/applications/drydock/management/DrydockManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class DrydockManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/fact/management/PhabricatorFactManagementWorkflow.php
===================================================================
--- src/applications/fact/management/PhabricatorFactManagementWorkflow.php
+++ src/applications/fact/management/PhabricatorFactManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorFactManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
===================================================================
--- src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
+++ src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
@@ -21,7 +21,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$key = $args->getArg('key');
if (count($key) < 1) {
Index: src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
===================================================================
--- src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
+++ src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorFeedManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/files/management/PhabricatorFilesManagementWorkflow.php
===================================================================
--- src/applications/files/management/PhabricatorFilesManagementWorkflow.php
+++ src/applications/files/management/PhabricatorFilesManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorFilesManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function buildIterator(PhutilArgumentParser $args) {
$names = $args->getArg('names');
@@ -20,7 +16,7 @@
if ($names) {
$query = id(new PhabricatorObjectQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withNames($names)
->withTypes(array(PhabricatorFilePHIDTypeFile::TYPECONST));
Index: src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
===================================================================
--- src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
+++ src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
@@ -23,7 +23,7 @@
}
public function execute(PhutilArgumentParser $args) {
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$names = $args->getArg('buildable');
if (count($names) != 1) {
Index: src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
===================================================================
--- src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
+++ src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class HarbormasterManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
===================================================================
--- src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
+++ src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
@@ -61,7 +61,7 @@
echo "\n";
while (true) {
$type = $supported_types[array_rand($supported_types)];
- $admin = PhabricatorUser::getOmnipotentUser();
+ $admin = $this->getViewer();
try {
$taskgen = newv($type, array());
$object = $taskgen->generate();
Index: src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
===================================================================
--- src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
+++ src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorLipsumManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
===================================================================
--- src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
+++ src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$mails = id(new PhabricatorMetaMTAReceivedMail())->loadAllWhere(
'1 = 1 ORDER BY id DESC LIMIT %d',
Index: src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
===================================================================
--- src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
+++ src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$mails = id(new PhabricatorMetaMTAMail())->loadAllWhere(
'1 = 1 ORDER BY id DESC LIMIT %d',
Index: src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
===================================================================
--- src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
+++ src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
@@ -42,7 +42,7 @@
}
$user = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($as))
->executeOne();
if (!$user) {
Index: src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
===================================================================
--- src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -61,7 +61,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$from = $args->getArg('from');
if ($from) {
Index: src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
===================================================================
--- src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
+++ src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorMailManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
===================================================================
--- src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
+++ src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
@@ -20,7 +20,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$obj_names = $args->getArg('objects');
if (!$obj_names) {
Index: src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
===================================================================
--- src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
+++ src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$obj_names = $args->getArg('objects');
if (!$obj_names) {
Index: src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
===================================================================
--- src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
+++ src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorPolicyManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
===================================================================
--- src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
+++ src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
@@ -51,7 +51,7 @@
}
$actor = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($username))
->executeOne();
Index: src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
===================================================================
--- src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
+++ src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
@@ -14,7 +14,7 @@
$console = PhutilConsole::getConsole();
$repos = id(new PhabricatorRepositoryQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->execute();
if ($repos) {
foreach ($repos as $repo) {
Index: src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
===================================================================
--- src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
+++ src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
@@ -89,7 +89,7 @@
}
return id(new PhabricatorHandleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withPHIDs(array($phid))
->executeOne();
}
Index: src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
===================================================================
--- src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
+++ src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorRepositoryManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function loadRepositories(PhutilArgumentParser $args, $param) {
$callsigns = $args->getArg($param);
@@ -15,7 +11,7 @@
}
$repos = id(new PhabricatorRepositoryQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withCallsigns($callsigns)
->execute();
@@ -37,7 +33,7 @@
}
$query = id(new DiffusionCommitQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIdentifiers($names);
$query->execute();
Index: src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
===================================================================
--- src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
+++ src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
@@ -92,7 +92,7 @@
private function loadPHIDsByNames(array $names) {
$query = id(new PhabricatorObjectQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withNames($names);
$query->execute();
$objects = $query->getNamedResults();
Index: src/applications/search/management/PhabricatorSearchManagementWorkflow.php
===================================================================
--- src/applications/search/management/PhabricatorSearchManagementWorkflow.php
+++ src/applications/search/management/PhabricatorSearchManagementWorkflow.php
@@ -1,13 +1,6 @@
<?php
-/**
- * @group search
- */
abstract class PhabricatorSearchManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
Index: src/infrastructure/management/PhabricatorManagementWorkflow.php
===================================================================
--- /dev/null
+++ src/infrastructure/management/PhabricatorManagementWorkflow.php
@@ -0,0 +1,16 @@
+<?php
+
+abstract class PhabricatorManagementWorkflow extends PhutilArgumentWorkflow {
+
+ public function isExecutable() {
+ return true;
+ }
+
+ public function getViewer() {
+ // Some day, we might provide a more general viewer mechanism to scripts.
+ // For now, workflows can call this method for convenience and future
+ // flexibility.
+ return PhabricatorUser::getOmnipotentUser();
+ }
+
+}
Index: src/infrastructure/ssh/PhabricatorSSHWorkflow.php
===================================================================
--- src/infrastructure/ssh/PhabricatorSSHWorkflow.php
+++ src/infrastructure/ssh/PhabricatorSSHWorkflow.php
@@ -1,6 +1,6 @@
<?php
-abstract class PhabricatorSSHWorkflow extends PhutilArgumentWorkflow {
+abstract class PhabricatorSSHWorkflow extends PhabricatorManagementWorkflow {
private $user;
private $iochannel;
@@ -24,10 +24,6 @@
return $this->user;
}
- final public function isExecutable() {
- return false;
- }
-
public function setIOChannel(PhutilChannel $channel) {
$this->iochannel = $channel;
return $this;
Index: src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
===================================================================
--- src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
+++ src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
@@ -1,7 +1,7 @@
<?php
abstract class PhabricatorStorageManagementWorkflow
- extends PhutilArgumentWorkflow {
+ extends PhabricatorManagementWorkflow {
private $patches;
private $api;
@@ -25,8 +25,4 @@
return $this->api;
}
- public function isExecutable() {
- return true;
- }
-
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 9:46 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6917790
Default Alt Text
D7838.id17750.diff (34 KB)

Event Timeline