mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 13:00:56 +01:00
Check if app is installed for user before displying
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 Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley, yelirekim Maniphest Tasks: T11595 Differential Revision: https://secure.phabricator.com/D16518
This commit is contained in:
parent
25bd14a9b1
commit
0030bda17e
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,12 @@ final class PhabricatorApplicationDatasource
|
|||
if (!$uri) {
|
||||
continue;
|
||||
}
|
||||
$is_installed = PhabricatorApplication::isClassInstalledForViewer(
|
||||
get_class($application),
|
||||
$viewer);
|
||||
if (!$is_installed) {
|
||||
continue;
|
||||
}
|
||||
$name = $application->getName().' '.$application->getShortDescription();
|
||||
$img = 'phui-font-fa phui-icon-view '.$application->getIcon();
|
||||
$results[] = id(new PhabricatorTypeaheadResult())
|
||||
|
|
Loading…
Reference in a new issue