Skip to content

Commit

Permalink
Updated environment config
Browse files Browse the repository at this point in the history
  • Loading branch information
happychuks committed Aug 9, 2024
1 parent eb67a99 commit b0f1b2b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
6 changes: 4 additions & 2 deletions server/apps/research/permissions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from rest_framework.permissions import BasePermission, SAFE_METHODS

from rest_framework.exceptions import PermissionDenied

class ArticleUserWritePermission(BasePermission):
message = 'Editing articles is restricted to the author only.'

def has_object_permission(self, request, view, obj):
if request.method in SAFE_METHODS:
return True
return obj.author == request.user
if obj.author != request.user:
raise PermissionDenied('You do not have permission to edit this article.')
return True
2 changes: 1 addition & 1 deletion server/core/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

CSP_SCRIPT_SRC = ("self",)

CSP_IMG_SRC = ("self",)
CSP_IMG_SRC = ("self", "http://cms.2077.xyz", "https:cms.2077.xyz")

CSP_FONT_SRC = ("self",)

Expand Down
20 changes: 17 additions & 3 deletions server/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
}

# CKEDITOR CONFIGS
CKEDITOR_UPLOAD_PATH = "images/ckeditor_uploads/"
CKEDITOR_UPLOAD_PATH = 'ckeditor_uploads/'

CKEDITOR_IMAGE_BACKEND = "pillow"

Expand Down Expand Up @@ -320,6 +320,9 @@
'blockQuote', 'fullscreen', 'removeFormat'],

'image': {
'upload': {
'path': 'ckeditor_uploads/',
},
'toolbar': ['imageTextAlternative', '|', 'imageStyle:alignLeft',
'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:side', 'imageResize', '|'],
'styles': [
Expand All @@ -328,8 +331,13 @@
'alignLeft',
'alignRight',
'alignCenter',
]
},'blockToolbar': {
],
'resize': {
'enabled': False # Disable image resizing
}
},

'blockToolbar': {
'items': [
'paragraph', 'heading1', 'heading2', 'heading3',
'|',
Expand All @@ -339,7 +347,13 @@
],
'location': 'left', # Position the block toolbar on the left
},
'plugins': {
'imageInsert': {
'enabled': True
}
}
},

'extends': {

},
Expand Down

0 comments on commit b0f1b2b

Please sign in to comment.