Page MenuHomePhabricator

Support bulk editing object policies
Open, WishlistPublic

"Burninate" token, awarded by timor."Party Time" token, awarded by spawnlt."Like" token, awarded by tomekj2ee."Like" token, awarded by michaeloa.
Assigned To
Authored By
Mar 25 2014, 6:19 PM


The bulk editor currently does not support adjusting object policies, so you can't use it to (for example) change the visibility of a large number of tasks.

After T10973, the bulk editor side of this is fairly easy. The UI side -- where we need to render a policy selector control dynamically in pure Javascript -- is not.

In the meantime, a possible workaround is that all modern *.edit API methods do support policy editing, so you may be able to use the API, rather than the bulk editor, to make sweeping policy changes.


The action menu in the bulk editor has no option for "Change Policy" / "Change Visibility" / etc

Event Timeline

shadowhand raised the priority of this task from to Needs Triage.
shadowhand updated the task description. (Show Details)
shadowhand added a project: Maniphest.
shadowhand added a subscriber: shadowhand.
epriestley added a subscriber: epriestley.

We should add "Change view policy" and "Change edit policy" actions here. I think these are straightforward.

btrahan edited this Maniphest Task.Apr 2 2014, 6:37 PM

I found the tricky part.... :) See D8677

btrahan triaged this task as Low priority.Apr 2 2014, 7:00 PM

Aside from being a bit of a corner / long tail case, implementing this is tricky business - see D8677. As such, putting to low priority and will circle back eventually.

wotte added a subscriber: wotte.May 6 2014, 8:11 PM

In D8677, @epriestley mentioned a 5 line script to bulk adjust policies - any chance of this being made available and/or made part of the command line tools? I'm planning on making my phab install a bit more public, but would like to make most of the old tasks/revisions only visible within the core team.

You should be able to do something like this:


require_once 'scripts/__init_script__.php';

foreach (id(new LiskMigrationIterator(new ManiphestTask()) as $task) {
  $id = $task->getID();
  echo "Updating task {$id}...\n";

  $task->setViewPolicy(/* Policy Goes Here */);

  // uncomment this when satisfied with the script behavior, to persist changes
  // $task->save();

Drop that in phabricator/ and run it with php -f script.php.

To figure out what the policy value should be, set some task to the desired policy, then examine the row in the database: SELECT viewPolicy FROM phabricator_maniphest.maniphest_task WHERE id = 123456

wotte added a comment.May 7 2014, 2:20 AM

require_once 'scripts/__init_script__.php';

foreach (id(new LiskMigrationIterator(new ManiphestTask())) as $task) {
  $id = $task->getID();
  echo "Updating task {$id}...\n";

  $task->setViewPolicy(/* Policy Goes Here */);

  // uncomment this when satisfied with the script behavior, to persist changes
  // $task->save();

Slight syntax correction, for the record.

◀ Merged tasks: T5898.

btrahan removed btrahan as the assignee of this task.Sep 12 2014, 8:02 PM
btrahan added a subscriber: btrahan.
spawnlt added a subscriber: spawnlt.
epriestley renamed this task from Maniphest batch editor does not allow bulk modification of visibility to Support bulk editing object policies.Jan 19 2018, 11:03 PM
epriestley lowered the priority of this task from Low to Wishlist.
epriestley updated the task description. (Show Details)
epriestley edited projects, added ApplicationEditor; removed Maniphest.
timor awarded a token.Sep 4 2018, 12:10 PM
timor added a subscriber: timor.
hskiba added a subscriber: hskiba.Jun 4 2019, 1:21 AM