Skip to content

Commit

Permalink
Merge pull request #162 from makinacorpus/fix_paperclip_permissions
Browse files Browse the repository at this point in the history
Fix permission read to read_attachment
  • Loading branch information
LePetitTim committed Jan 8, 2019
2 parents f22816d + 9eed9ad commit 4d1a974
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mapentity/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def serve_attachment(request, path, app_label, model_name, pk):
if not obj.is_public():
if not request.user.is_authenticated():
raise PermissionDenied
if not request.user.has_perm(get_attachment_permission('read')):
if not request.user.has_perm(get_attachment_permission('read_attachment')):
raise PermissionDenied
if not request.user.has_perm('{}.read_{}'.format(app_label, model_name)):
raise PermissionDenied
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ idna==2.6
ipaddress==1.0.19
lxml==4.2.1
mock==2.0.0
paperclip==2.2.0
paperclip==2.2.1
pbr==4.0.1
pdfrw==0.4
Pillow==5.3.*
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'djangorestframework-gis>=0.13',
'easy-thumbnails>=2.5.0',
'lxml>=4.2.1',
'paperclip>=2.2.0',
'paperclip>=2.2.1',
'requests>=2.20.0',
'WeasyPrint<0.42', # 0.42 drops support of python 2.7,
] + test_requires,
Expand Down

0 comments on commit 4d1a974

Please sign in to comment.