Revert "Basic architecture of Maintenance App - SUST-19, SUST-42. Implement Force Publish Course view. SUST-46"
This reverts commit 27646b7e6f.
This commit is contained in:
@@ -35,7 +35,6 @@ from util.file import (
|
||||
FileValidationException, UniversalNewlineIterator
|
||||
)
|
||||
from util.json_request import JsonResponse, JsonResponseBadRequest
|
||||
from util.views import require_global_staff
|
||||
from instructor.views.instructor_task_helpers import extract_email_features, extract_task_features
|
||||
|
||||
from courseware.access import has_access
|
||||
@@ -206,6 +205,20 @@ def require_level(level):
|
||||
return decorator
|
||||
|
||||
|
||||
def require_global_staff(func):
|
||||
"""View decorator that requires that the user have global staff permissions. """
|
||||
def wrapped(request, *args, **kwargs): # pylint: disable=missing-docstring
|
||||
if GlobalStaff().has_user(request.user):
|
||||
return func(request, *args, **kwargs)
|
||||
else:
|
||||
return HttpResponseForbidden(
|
||||
u"Must be {platform_name} staff to perform this action.".format(
|
||||
platform_name=theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
|
||||
)
|
||||
)
|
||||
return wrapped
|
||||
|
||||
|
||||
def require_sales_admin(func):
|
||||
"""
|
||||
Decorator for checking sales administrator access before executing an HTTP endpoint. This decorator
|
||||
|
||||
Reference in New Issue
Block a user