Page MenuHomePhabricator

Bind file thumbnail visibility to the visibility of the original files
ClosedPublic

Authored by epriestley on Sep 4 2014, 3:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 2:30 AM
Unknown Object (File)
Mon, Apr 8, 2:45 PM
Unknown Object (File)
Thu, Apr 4, 9:57 PM
Unknown Object (File)
Fri, Mar 29, 12:34 PM
Unknown Object (File)
Wed, Mar 27, 1:40 PM
Unknown Object (File)
Mar 4 2024, 6:29 AM
Unknown Object (File)
Mar 4 2024, 6:29 AM
Unknown Object (File)
Mar 4 2024, 6:29 AM
Subscribers

Details

Summary

Ref T6013. Currently, when we create a thumbnail, it gets its own (default) file visibility policy.

In particular, this causes the issue in T6013: thumbnails get "all users" visibility, which does not include logged-out users.

Instead, a thumbnail should just have the same visibility as the original file does. Enforce this:

  • When loading thumbnails, reject thumbnails with invisible originals.
  • When filtering thumbnails, permit thumbnails with visible originals.
Test Plan

As a logged-out user, thumbnails are now visible when the original files are attached to visible objects.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Bind file thumbnail visibility to the visibility of the original files.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
  • Add a bunch of test coverage since this interaction isn't trivial.
btrahan edited edge metadata.

<3 me some unit tests

src/applications/files/query/PhabricatorFileQuery.php
176

you could use PHID_VOID as the default in the idx() call, and then just use one if ($original_phid != PHID_VOID)

This revision is now accepted and ready to land.Sep 4 2014, 7:33 PM
epriestley updated this revision to Diff 25067.

Closed by commit rP2e0361bd98c4 (authored by @epriestley).