My quick fix for T366451 in https://gitlab.wikimedia.org/repos/phabricator/phabricator/-/commit/7e1314fcce2ec2bb1d19e528163b517d17e93ea6 makes people with legitimate intentions run into this limitation and that is bad.
Ideally, the code should return a different $maximum based on the $viewer's membership (in Trusted-Contributors, WMF-NDA, etc.) only when an actor attempts to edit edges but not on the storage level, however $relationship->getMaximumSelectionSize(); does not pass / care about the $viewer.
Thus probably revert my custom changes and instead add a custom change checking for actor group membership in https://we.phorge.it/source/phorge/browse/master/src/applications/search/controller/PhabricatorSearchRelationshipController.php instead?Also test that it affects both UI edits and API edits.