Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15367246
D11390.id27352.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11390.id27352.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11390: Check if user can create project before showing shortcut
Attached
Detach File
Event Timeline
Log In to Comment