Page MenuHomePhabricator

Give PhabricatorDestructionEngine a getViewer() method to reduce omnipotence calls
Closed, ResolvedPublic

Description

A routine use of PhabricatorUser::getOmnipotentUser() is loading related objects inside destroyObjectPermanently(), so they can also be destroyed.

This is correct, but makes it more difficult to audit calls to getOmnipotentUser() because it adds several of them to many applications. It seems desirable to organize these calls as much as possible, as their misuse can cause major policy violations.

It would be cleaner to provide a getViewer() method on the $engine (which just returns the omnipotent user), then call that. This would leave us with fewer hits for git grep -i getOmnipotentUser and generally better organization of access to omnipotence.

Revisions and Commits

Restricted Differential Revision

Event Timeline

epriestley raised the priority of this task from to Wishlist.
epriestley updated the task description. (Show Details)
epriestley added a project: Infrastructure.
epriestley added a subscriber: epriestley.
btrahan added a revision: Restricted Differential Revision.May 15 2015, 9:02 PM
btrahan closed this task as Resolved by committing Restricted Diffusion Commit.May 15 2015, 9:07 PM
btrahan added a commit: Restricted Diffusion Commit.