Page MenuHomePhabricator

Lock policy queries to their applications

Authored by epriestley on Oct 20 2013, 1:35 AM.
Referenced Files
Unknown Object (File)
Mon, Nov 14, 6:26 PM
Unknown Object (File)
Sun, Nov 13, 9:24 PM
Unknown Object (File)
Sat, Nov 12, 2:59 PM
Unknown Object (File)
Sat, Oct 29, 8:10 PM
Unknown Object (File)
Oct 24 2022, 5:19 AM
Unknown Object (File)
Oct 21 2022, 5:02 AM
Unknown Object (File)
Oct 18 2022, 3:36 AM
Unknown Object (File)
Oct 17 2022, 12:46 AM


Restricted Diffusion Commit
rP2a5c987c714d: Lock policy queries to their applications

While we mostly have reasonable effective object accessibility when you lock a user out of an application, it's primarily enforced at the controller level. Users can still, e.g., load the handles of objects they can't actually see. Instead, lock the queries to the applications so that you can, e.g., never load a revision if you don't have access to Differential.

This has several parts:

  • For PolicyAware queries, provide an application class name method.
  • If the query specifies a class name and the user doesn't have permission to use it, fail the entire query unconditionally.
  • For handles, simplify query construction and count all the PHIDs as "restricted" so we get a UI full of "restricted" instead of "unknown" handles.
Test Plan
  • Added a unit test to verify I got all the class names right.
  • Browsed around, logged in/out as a normal user with public policies on and off.
  • Browsed around, logged in/out as a restricted user with public policies on and off. With restrictions, saw all traces of restricted apps removed or restricted.

Diff Detail

Lint Skipped
Tests Skipped

Event Timeline

LGTM. I dunno how you track TODOs but I wouldn't want to lose 'em if we need a super serious T603 v2 or what have you.