misc: fix asset overwrite when CKEDITOR_RESTRICT_BY_USER is set

This commit is contained in:
Frédéric Péters 2017-12-30 13:52:18 +01:00
parent 8654f59e38
commit 23e45534d1
1 changed files with 1 additions and 1 deletions

View File

@ -456,7 +456,7 @@ class AssetOverwrite(FormView):
raise PermissionDenied() # better safe than sorry
base_path = settings.CKEDITOR_UPLOAD_PATH
if getattr(settings, 'CKEDITOR_RESTRICT_BY_USER', False):
base_path = os.path.join(base_path, request.user.username)
base_path = os.path.join(base_path, self.request.user.username)
if not img_orig.startswith(base_path):
raise PermissionDenied()