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

Merge branch 'master' into 'master'

Fix security issue

Closes #1180

See merge request !1692
parents acce2ce3 adbca0d3
No related branches found
No related tags found
1 merge request!1692Fix security issue
Pipeline #195107 failed
......@@ -96,6 +96,7 @@ Fixed
* Update and fix URLs for 3rdparty login.
* The OpenID Connect Discovery endpoint now returns the issuer data directly
under the URI without a trailing `/`.
* Not-logged in users were able to access all PDF files.
Removed
~~~~~~~
......
......@@ -246,9 +246,9 @@ class Query(graphene.ObjectType):
def resolve_pdf_by_id(root, info, id, **kwargs): # noqa
pdf_file = PDFFile.objects.get(pk=id)
if has_person(info.context) and info.context.user.person != pdf_file.person:
return None
return pdf_file
if has_person(info.context) and info.context.user.person == pdf_file.person:
return pdf_file
return None
def resolve_search_snippets(root, info, query, limit=-1, **kwargs):
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