Skip to content

Commit a63b80c

Browse files
committed
fixup! feat: add authz permission to search_reindex endpoint
1 parent 496500e commit a63b80c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cms/djangoapps/contentstore/views/course.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,11 @@ def course_search_index_handler(request, course_key_string):
374374
"""
375375
course_key = CourseKey.from_string(course_key_string)
376376
is_authz_enabled = core_toggles.AUTHZ_COURSE_AUTHORING_FLAG.is_enabled(course_key)
377-
if not is_authz_enabled:
377+
if not is_authz_enabled and not GlobalStaff().has_user(request.user):
378378
# Under AuthZ, users with course authoring permissions can index courses,
379379
# so no staff check is necessary.
380380
# Under the legacy system, only global staff (PMs) can index courses.
381-
if not GlobalStaff().has_user(request.user):
382-
raise PermissionDenied()
381+
raise PermissionDenied()
383382
content_type = request.META.get('CONTENT_TYPE', None)
384383
if content_type is None:
385384
content_type = "application/json; charset=utf-8"

0 commit comments

Comments
 (0)