Page MenuHomePhabricator

D14817.diff
No OneTemporary

D14817.diff

diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
@@ -84,6 +84,8 @@
$issue->addPhabricatorConfig($key);
}
}
+
+ $this->executeManiphestFieldChecks();
}
/**
@@ -300,4 +302,70 @@
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'));
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 12:32 AM (15 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7014225
Default Alt Text
D14817.diff (2 KB)

Event Timeline