1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

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
This commit is contained in:
tycho 2015-10-18 04:22:05 -07:00 committed by epriestley
parent 92a626fc1c
commit 0e8ed0c616

View file

@ -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())