summaryrefslogtreecommitdiff
path: root/app/Controller/App.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-23 19:57:43 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-23 19:57:43 -0400
commitffeffa54f9ad322e8b1a79d9ab5270854d712ea2 (patch)
treef6808b61caa92e1689982c927d149132e84e1f8b /app/Controller/App.php
parent9707c0b4c4145b9fbdab3a2ecb40c92633dacab1 (diff)
People should not see any tasks during a search when they are not associated to a project
Diffstat (limited to 'app/Controller/App.php')
-rw-r--r--app/Controller/App.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php
index 01a74c7a..2fae004c 100644
--- a/app/Controller/App.php
+++ b/app/Controller/App.php
@@ -227,10 +227,15 @@ class App extends Base
public function autocomplete()
{
$search = $this->request->getStringParam('term');
+ $projects = $this->projectPermission->getActiveMemberProjectIds($this->userSession->getId());
+
+ if (empty($projects)) {
+ $this->response->json(array());
+ }
$filter = $this->taskFilterAutoCompleteFormatter
->create()
- ->filterByProjects($this->projectPermission->getActiveMemberProjectIds($this->userSession->getId()))
+ ->filterByProjects($projects)
->excludeTasks(array($this->request->getIntegerParam('exclude_task_id')));
// Search by task id or by title