diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php index de087096fb..a37e655853 100644 --- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php +++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php @@ -84,6 +84,8 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { $issue->addPhabricatorConfig($key); } } + + $this->executeManiphestFieldChecks(); } /** @@ -300,4 +302,70 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { return $ancient_config; } + + private function executeManiphestFieldChecks() { + $maniphest_appclass = 'PhabricatorManiphestApplication'; + if (!PhabricatorApplication::isClassInstalled($maniphest_appclass)) { + return; + } + + $capabilities = array( + ManiphestEditAssignCapability::CAPABILITY, + ManiphestEditPoliciesCapability::CAPABILITY, + ManiphestEditPriorityCapability::CAPABILITY, + ManiphestEditProjectsCapability::CAPABILITY, + ManiphestEditStatusCapability::CAPABILITY, + ); + + // Check for any of these capabilities set to anything other than + // "All Users". + + $any_set = false; + $app = new PhabricatorManiphestApplication(); + foreach ($capabilities as $capability) { + $setting = $app->getPolicy($capability); + if ($setting != PhabricatorPolicies::POLICY_USER) { + $any_set = true; + break; + } + } + + if (!$any_set) { + return; + } + + $issue_summary = pht( + 'Maniphest is currently configured with deprecated policy settings '. + 'which will be removed in a future version of Phabricator.'); + + + $message = pht( + 'Some policy settings in Maniphest are now deprecated and will be '. + 'removed in a future version of Phabricator. You are currently using '. + 'at least one of these settings.'. + "\n\n". + 'The deprecated settings are "Can Assign Tasks", '. + '"Can Edit Task Policies", "Can Prioritize Tasks", '. + '"Can Edit Task Projects", and "Can Edit Task Status". You can '. + 'find these settings in Applications, or follow the link below.'. + "\n\n". + 'You can find discussion of this change (including rationale and '. + 'recommendations on how to configure similar features) in the upstream, '. + 'at the link below.'. + "\n\n". + 'To resolve this issue, set all of these policies to "All Users" after '. + 'making any necessary form customization changes.'); + + $more_href = 'https://secure.phabricator.com/T10003'; + $edit_href = '/applications/view/PhabricatorManiphestApplication/'; + + $issue = $this->newIssue('maniphest.T10003-per-field-policies') + ->setShortName(pht('Deprecated Policies')) + ->setName(pht('Deprecated Maniphest Field Policies')) + ->setSummary($issue_summary) + ->setMessage($message) + ->addLink($more_href, pht('Learn More: Upstream Discussion')) + ->addLink($edit_href, pht('Edit These Settings')); + } + }