Commit d1c7a800 authored by Michal Čihař's avatar Michal Čihař

Filter search results by ACL

We should not really show search results for private projects to not
authenticated users.

Fixes #468
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent c99ee751
...@@ -126,6 +126,13 @@ def search(request): ...@@ -126,6 +126,13 @@ def search(request):
'translation', 'translation',
) )
# Filter results by ACL
acl_projects, filtered = Project.objects.get_acl_status(request.user)
if filtered:
units = units.filter(
translation__subproject__project__in=acl_projects
)
limit = request.GET.get('limit', 50) limit = request.GET.get('limit', 50)
page = request.GET.get('page', 1) page = request.GET.get('page', 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment