diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 17560e11d1..09b8b86da4 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3081,6 +3081,7 @@ phutil_register_library_map(array( 'PhabricatorDashboardColumn' => 'applications/dashboard/layoutconfig/PhabricatorDashboardColumn.php', 'PhabricatorDashboardConsoleController' => 'applications/dashboard/controller/PhabricatorDashboardConsoleController.php', 'PhabricatorDashboardController' => 'applications/dashboard/controller/PhabricatorDashboardController.php', + 'PhabricatorDashboardCreateCapability' => 'applications/countdown/capability/PhabricatorDashboardCreateCapability.php', 'PhabricatorDashboardDAO' => 'applications/dashboard/storage/PhabricatorDashboardDAO.php', 'PhabricatorDashboardDashboardPHIDType' => 'applications/dashboard/phid/PhabricatorDashboardDashboardPHIDType.php', 'PhabricatorDashboardDatasource' => 'applications/dashboard/typeahead/PhabricatorDashboardDatasource.php', @@ -9496,6 +9497,7 @@ phutil_register_library_map(array( 'PhabricatorDashboardColumn' => 'Phobject', 'PhabricatorDashboardConsoleController' => 'PhabricatorDashboardController', 'PhabricatorDashboardController' => 'PhabricatorController', + 'PhabricatorDashboardCreateCapability' => 'PhabricatorPolicyCapability', 'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO', 'PhabricatorDashboardDashboardPHIDType' => 'PhabricatorPHIDType', 'PhabricatorDashboardDatasource' => 'PhabricatorTypeaheadDatasource', diff --git a/src/applications/countdown/capability/PhabricatorDashboardCreateCapability.php b/src/applications/countdown/capability/PhabricatorDashboardCreateCapability.php new file mode 100644 index 0000000000..c610df069e --- /dev/null +++ b/src/applications/countdown/capability/PhabricatorDashboardCreateCapability.php @@ -0,0 +1,16 @@ + array( + 'default' => PhabricatorPolicies::POLICY_USER, + 'caption' => pht('Default create policy for Dashboards.'), + ), + ); + } } diff --git a/src/applications/dashboard/editor/PhabricatorDashboardEditEngine.php b/src/applications/dashboard/editor/PhabricatorDashboardEditEngine.php index 06b0a3a6fb..84b36fe546 100644 --- a/src/applications/dashboard/editor/PhabricatorDashboardEditEngine.php +++ b/src/applications/dashboard/editor/PhabricatorDashboardEditEngine.php @@ -66,6 +66,11 @@ final class PhabricatorDashboardEditEngine return $object->getURI(); } + protected function getCreateNewObjectPolicy() { + return $this->getApplication()->getPolicy( + PhabricatorDashboardCreateCapability::CAPABILITY); + } + protected function buildCustomEditFields($object) { $layout_options = PhabricatorDashboardLayoutMode::getLayoutModeMap();