In Phortune accounts, prevent self-removal more narrowly


In Phortune accounts, prevent self-removal more narrowly

Currently, Phortune attempts to prevent users from removing themselves as account managers. It does this by checking that the new list includes them.

Usually this is sufficient, because you can't normally edit an account unless you're already a manager. However, we get the wrong result (incorrect rejection of the edit) if the actor is omnipotent and the acting user was not already a member.

It's okay to edit an account into a state which doesn't include you if you have permission to edit the account and aren't already a manager.

Specifically, this supports more formal tooling around staff modifications to billing accounts, where the actor has staff-omnipotence and the acting user is a staff member and only used for purposes of leaving a useful audit trail.

Test Plan: Elsewhere, ran staff tooling to modify accounts and was able to act as "alice" to add "bailey", even though "alice" was not herself a manager.

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


epriestleyAuthored on May 26 2020, 2:02 PM
epriestleyPushed on May 26 2020, 2:09 PM
Differential Revision
D21288: In Phortune accounts, prevent self-removal more narrowly
rPa529efa5b855: Fix an issue where inline comments with only edit suggestions are considered…
Build Status
Buildable 24514
Build 33782: Run Core Tests