Commit 0e8ed0c6 authored by tycho's avatar tycho Committed by epriestley
Browse files

Desactivate subtask when logged out.

Summary: Fixes T9592.

Test Plan: Log out ! Navigates to a task. See the add button grey-ed out !

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T9592

Differential Revision: https://secure.phabricator.com/D14299
parent 92a626fc
......@@ -381,7 +381,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
private function buildActionView(ManiphestTask $task) {
$viewer = $this->getRequest()->getUser();
$viewer_phid = $viewer->getPHID();
$id = $task->getID();
$phid = $task->getPHID();
......@@ -391,6 +390,8 @@ final class ManiphestTaskDetailController extends ManiphestController {
$task,
PhabricatorPolicyCapability::CAN_EDIT);
$can_create = $viewer->isLoggedIn();
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($task)
......@@ -417,7 +418,9 @@ final class ManiphestTaskDetailController extends ManiphestController {
id(new PhabricatorActionView())
->setName(pht('Create Subtask'))
->setHref($this->getApplicationURI("/task/create/?parent={$id}"))
->setIcon('fa-level-down'));
->setIcon('fa-level-down'))
->setDisabled(!$can_create)
->setWorkflow(!$can_create);
$view->addAction(
id(new PhabricatorActionView())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment