@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Apply "Can Bulk Edit Tasks" to "Move Tasks" workboard options

Summary: The "Can Bulk Edit Tasks" Maniphest application setting introduced in rP7fedfacbca27c165cf193f286cef9306cf9762e2 applies to the "Bulk Edit Tasks…" menu item in the project workboard column dropdown. Make it also apply to the menu items "Move Tasks to Column…" and "Move Tasks to Project…" as those are similar actions.

Test Plan:
1. Go to `/applications/view/PhabricatorManiphestApplication/` and set `Can Bulk Edit Tasks` to `Administrators`
2. Go to `/project/board/1/` and create a second column
3. As a default user, open the column header dropdown of the default column on `/project/board/1/`
4. Select `Bulk Edit Tasks…` (no changes in behavior)
5. Select `Move Tasks to Column…`; select `Move Tasks to Project…`, don't succeed.
6. Try step 5 again as an administrator, succeed.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25912

+21 -5
+7 -5
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 728 728 ->setIcon('fa-search') 729 729 ->setHref($query_uri); 730 730 731 + $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( 732 + $viewer, 733 + PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), 734 + ManiphestBulkEditCapability::CAPABILITY); 735 + 731 736 $column_move_uri = urisprintf('bulkmove/%d/column/', $column->getID()); 732 737 $column_move_uri = $state->newWorkboardURI($column_move_uri); 733 738 ··· 735 740 ->setIcon('fa-arrows-h') 736 741 ->setName(pht('Move Tasks to Column...')) 737 742 ->setHref($column_move_uri) 743 + ->setDisabled(!$can_bulk_edit) 738 744 ->setWorkflow(true); 739 745 740 746 $project_move_uri = urisprintf('bulkmove/%d/project/', $column->getID()); ··· 744 750 ->setIcon('fa-arrows') 745 751 ->setName(pht('Move Tasks to Project...')) 746 752 ->setHref($project_move_uri) 753 + ->setDisabled(!$can_bulk_edit) 747 754 ->setWorkflow(true); 748 755 749 756 $bulk_edit_uri = urisprintf('bulk/%d/', $column->getID()); 750 757 $bulk_edit_uri = $state->newWorkboardURI($bulk_edit_uri); 751 - 752 - $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( 753 - $viewer, 754 - PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), 755 - ManiphestBulkEditCapability::CAPABILITY); 756 758 757 759 $column_items[] = id(new PhabricatorActionView()) 758 760 ->setIcon('fa-pencil-square-o')
+14
src/applications/project/controller/PhabricatorProjectColumnBulkMoveController.php
··· 40 40 41 41 $move_tasks = array_select_keys($tasks, $move_task_phids); 42 42 43 + $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( 44 + $viewer, 45 + PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), 46 + ManiphestBulkEditCapability::CAPABILITY); 47 + 48 + if (!$can_bulk_edit) { 49 + return $this->newDialog() 50 + ->setTitle(pht('No Movable Tasks')) 51 + ->appendParagraph( 52 + pht( 53 + 'You do not have permission to bulk edit tasks.')) 54 + ->addCancelButton($board_uri); 55 + } 56 + 43 57 $move_tasks = id(new PhabricatorPolicyFilter()) 44 58 ->setViewer($viewer) 45 59 ->requireCapabilities(array(PhabricatorPolicyCapability::CAN_EDIT))