Page MenuHomePhabricator

Check if app is installed for user before displying
ClosedPublic

Authored by jcox on Sep 8 2016, 6:23 PM.
Tags
None
Referenced Files
F14371376: D16518.id39753.diff
Fri, Dec 20, 6:56 PM
Unknown Object (File)
Tue, Dec 17, 9:10 AM
Unknown Object (File)
Tue, Dec 17, 5:39 AM
Unknown Object (File)
Mon, Dec 16, 7:16 PM
Unknown Object (File)
Wed, Dec 11, 4:32 PM
Unknown Object (File)
Sat, Dec 7, 8:36 AM
Unknown Object (File)
Wed, Dec 4, 1:15 PM
Unknown Object (File)
Tue, Dec 3, 10:53 AM

Details

Summary

Fixes T11595. Previously if a user didn't have permissions to view an application it would still appear in the application typeahead in various menus. This change will prevent that by checking if the app is installed for the viewer before displaying it as an option

Test Plan

I went to the "Pin Applications" menu and typed in "Conpherence" and saw it appear as an option. I then went to the "Edit Policies" menu as an admin and removed permissions for my user to use Conpherence. Once I did that, it no longer showed up in the typeahead menu

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jcox retitled this revision from to Check if app is installed for user before displying.
jcox updated this object.
jcox edited the test plan for this revision. (Show Details)
epriestley added a reviewer: epriestley.
epriestley added inline comments.
src/applications/meta/typeahead/PhabricatorApplicationDatasource.php
30–33

For consistency, consider formatting this like this, with one parameter per line and more-verbose but simpler structure:

$is_installed = X::Y(
  $x,
  $y);
if (!$is_installed) {
  continue;
}

Wrapping to one parameter per line makes it harder to miss things like ..., true) hiding in the end of a nested line (I think ..., true) is usually a bad API, but we have some of them).

This revision is now accepted and ready to land.Sep 8 2016, 6:38 PM
jcox edited edge metadata.

Update formatting

This revision was automatically updated to reflect the committed changes.
jcox marked an inline comment as done.