Page MenuHomePhabricator

Fix excessively strict "Can Use Application" policy filtering
ClosedPublic

Authored by epriestley on Jan 8 2017, 6:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 8:19 AM
Unknown Object (File)
Fri, Mar 29, 11:04 AM
Unknown Object (File)
Wed, Mar 27, 12:31 PM
Unknown Object (File)
Mar 12 2024, 9:51 AM
Unknown Object (File)
Mar 4 2024, 8:22 PM
Unknown Object (File)
Jan 21 2024, 12:04 PM
Unknown Object (File)
Jan 19 2024, 10:06 PM
Unknown Object (File)
Nov 30 2023, 4:58 AM
Subscribers
None

Details

Summary

Ref T9058. The stricter filtering is over-filtering Handles. For example, in the Phacility cluster, users can not see Almanac services.

So this filtering happens:

  • The AlmanacServiceQuery filters the service beacuse they can't see the application.
  • The HandleQuery generates a "you can't see this" handle.
  • But then the HandleQuery filters that handle! It has a "service" PHID and the user can't see Almanac.

This violates the assumption that all application code makes about handles: it's OK to query handles for objects you can't see, and you'll get something back.

Instead, don't do application filtering on handles.

Test Plan
  • Added a failing test and made it pass.
  • As a user who can not see Almanac, viewed an Instances timeline.
    • Before patch: fatal on trying to load a handle for a Service.
    • After patch: smooth sailing.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I'm going to merge, cherry-pick and deploy this since instance administration is more or less toast without it: normal users can't see Almanac, and every instance gets Almanac transactions during creation as a side-effect of setup.

I missed this in testing because I can see Almanac just fine.

src/applications/policy/filter/PhabricatorPolicyFilter.php
882

Fixed this typo locally.

This revision was automatically updated to reflect the committed changes.

I sent this to production and verified that a non-administrator test account no longer hits this when trying to view instance timelines containing service transactions.