Page MenuHomePhabricator

D11390.id27352.diff
No OneTemporary

D11390.id27352.diff

diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -25,6 +25,10 @@
ManiphestEditProjectsCapability::CAPABILITY);
$can_edit_status = $this->hasApplicationCapability(
ManiphestEditStatusCapability::CAPABILITY);
+ $can_create_projects = PhabricatorPolicyFilter::hasCapability(
+ $user,
+ PhabricatorApplication::getByClass('PhabricatorProjectApplication'),
+ ProjectCreateProjectsCapability::CAPABILITY);
$parent_task = null;
$template_id = null;
@@ -664,6 +668,17 @@
}
if ($can_edit_projects) {
+ $caption = null;
+ if ($can_create_projects) {
+ $caption = javelin_tag(
+ 'a',
+ array(
+ 'href' => '/project/create/',
+ 'mustcapture' => true,
+ 'sigil' => 'project-create',
+ ),
+ pht('Create New Project'));
+ }
$form
->appendChild(
id(new AphrontFormTokenizerControl())
@@ -671,15 +686,7 @@
->setName('projects')
->setValue($projects_value)
->setID($project_tokenizer_id)
- ->setCaption(
- javelin_tag(
- 'a',
- array(
- 'href' => '/project/create/',
- 'mustcapture' => true,
- 'sigil' => 'project-create',
- ),
- pht('Create New Project')))
+ ->setCaption($caption)
->setDatasource(new PhabricatorProjectDatasource()));
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 12, 4:41 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7522504
Default Alt Text
D11390.id27352.diff (1 KB)

Event Timeline