1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-27 06:58:17 +01:00
phorge-phorge/src
epriestley b8f6248e07 Fix an issue where handles could load with the incorrect viewer when building mail about changes to related objects
Summary:
See <https://phabricator.wikimedia.org/T179591>. Some time ago, all handle rendering preloaded handles: things emitted a list of PHIDs they'd need handles for, then later used only those PHIDs.

Later, we introduced `HandlePool` and lazy/on-demand handle loading. Modern transactions mostly use this to render object PHIDs.

When we build mail, many newer transactions use an on-demand load to fetch handles to render transactions. This on-demand load may use the original viewer (the acting user) instead of the correct viewer (the mail recipient): we fetch and reset handles using the correct viewer, but do not overwrite the active viewer for on-demand loading. This could cause mail to leak the titles of related objects to users who don't have permission to see them.

Instead, just reload the transactions with the correct viewer when building mail instead of playing a bunch of `setViewer()` and `clone` games. Until we're 100% on modular transactions, several pieces of the stack cache viewer or state information.

Test Plan:
  - Created task A (public) with subtask B (private).
  - Closed subtask B as a user with access to it.
  - Viewed mail sent to subscribers of task A who can not see subtask B.
    - Before change: mail discloses title of subtask B.
    - After change: mail properly labels subtask B as "Restricted Task".

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20525
2019-05-21 12:12:13 -07:00
..
__tests__ Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
aphront Add "Move Left" and "Move Right" to dashboard tab panels 2019-05-01 15:35:53 -07:00
applications Fix an issue where handles could load with the incorrect viewer when building mail about changes to related objects 2019-05-21 12:12:13 -07:00
docs Update "Autoclose" documentation to focus on "Permanent Refs" instead 2019-04-18 05:43:15 -07:00
extensions
infrastructure Make very minor generality improvements to the scope selector 2019-04-30 06:52:29 -07:00
view Show "hold reasons" on commit page, not on "Edit" page 2019-04-25 09:22:49 -07:00
__phutil_library_init__.php
__phutil_library_map__.php Separate the "configuration" and "evaluation" phases of chart functions 2019-05-19 16:54:53 -07:00