Skip to content
Snippets Groups Projects
Verified Commit adbca0d3 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Deny access to PDF files for unauthenticated users

parent acce2ce3
No related branches found
No related tags found
1 merge request!1692Fix security issue
...@@ -96,6 +96,7 @@ Fixed ...@@ -96,6 +96,7 @@ Fixed
* Update and fix URLs for 3rdparty login. * Update and fix URLs for 3rdparty login.
* The OpenID Connect Discovery endpoint now returns the issuer data directly * The OpenID Connect Discovery endpoint now returns the issuer data directly
under the URI without a trailing `/`. under the URI without a trailing `/`.
* Not-logged in users were able to access all PDF files.
Removed Removed
~~~~~~~ ~~~~~~~
......
...@@ -246,9 +246,9 @@ class Query(graphene.ObjectType): ...@@ -246,9 +246,9 @@ class Query(graphene.ObjectType):
def resolve_pdf_by_id(root, info, id, **kwargs): # noqa def resolve_pdf_by_id(root, info, id, **kwargs): # noqa
pdf_file = PDFFile.objects.get(pk=id) pdf_file = PDFFile.objects.get(pk=id)
if has_person(info.context) and info.context.user.person != pdf_file.person: if has_person(info.context) and info.context.user.person == pdf_file.person:
return None return pdf_file
return pdf_file return None
def resolve_search_snippets(root, info, query, limit=-1, **kwargs): def resolve_search_snippets(root, info, query, limit=-1, **kwargs):
indexed_models = UnifiedIndex().get_indexed_models() indexed_models = UnifiedIndex().get_indexed_models()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment