Homec4science

Reduce PhabricatorUser::getOmnipotentUser calls by adding a getViewer method to…

Authored by Bob Trahan <btrahan@phacility.com> on May 15 2015, 23:07.

Description

Reduce PhabricatorUser::getOmnipotentUser calls by adding a getViewer method to PhbaricatorDestructionEngine

Summary:
Fixes T6956. Before this change, we called PhabricatorUser::getOmnipotentUser in the various delete methods to query the data. Now, we use $engine->getViewer(), since its always a good thing to have less calls to PhabricatorUser::getOmnipotentUser thrown around the codebase.

I used the "codemod" tool to audit the existing calls to PhabricatorDestructorEngine (all of them) so ostensibly this gets all the spots. If I missed something though, its still going to work, so this change is very low risk.

Test Plan: ./bin/remove destroy P1; visit P1 and get a 404

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6956

Differential Revision: https://secure.phabricator.com/D12866

Details

Committed
Bob Trahan <btrahan@phacility.com>May 15 2015, 23:07
Pushed
aubortJan 31 2017, 17:16
Parents
rPHb6733e4a8643: Phame - move over post creation and edit to use an editor
Branches
Unknown
Tags
Unknown

Event Timeline

Bob Trahan <btrahan@phacility.com> committed rPH3ef0721adacc: Reduce PhabricatorUser::getOmnipotentUser calls by adding a getViewer method to… (authored by Bob Trahan <btrahan@phacility.com>).May 15 2015, 23:07