Page MenuHomePhabricator

In Phortune accounts, prevent self-removal more narrowly
ClosedPublic

Authored by epriestley on May 26 2020, 2:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 9 2024, 8:09 AM
Unknown Object (File)
Jan 5 2024, 11:45 PM
Unknown Object (File)
Jan 5 2024, 1:23 PM
Unknown Object (File)
Dec 28 2023, 6:10 PM
Unknown Object (File)
Dec 22 2023, 6:36 AM
Unknown Object (File)
Dec 21 2023, 4:49 AM
Unknown Object (File)
Dec 17 2023, 7:42 AM
Unknown Object (File)
Dec 17 2023, 2:33 AM
Subscribers
None

Details

Summary

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.

Diff Detail

Repository
rP Phabricator
Branch
modify-any
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24513
Build 33781: Run Core Tests
Build 33780: arc lint + arc unit

Event Timeline

epriestley edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.May 26 2020, 2:09 PM
This revision was automatically updated to reflect the committed changes.