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
Unknown Object (File)
Fri, May 3, 2:30 PM
Unknown Object (File)
Wed, Apr 24, 3:23 PM
Unknown Object (File)
Tue, Apr 16, 7:28 AM
Unknown Object (File)
Fri, Apr 12, 8:33 AM
Unknown Object (File)
Apr 8 2024, 3:31 PM
Unknown Object (File)
Apr 6 2024, 4:11 PM
Unknown Object (File)
Apr 6 2024, 2:57 AM
Unknown Object (File)
Apr 4 2024, 6:14 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.