Skip to content

Commit

Permalink
fix: course_permission_check calls
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpalmerio committed Sep 26, 2023
1 parent e511114 commit 19c0039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _course_team_user(request, course_key, email):
# below will never be true.
# Remove the .has_user call when course roles are implemented.
if (role(course_key).has_user(user) or
course_permission_check(user, course_key, MANAGE_ALL_USERS_PERMISSION)):
course_permission_check(user, MANAGE_ALL_USERS_PERMISSION, course_key)):
msg["role"] = role.ROLE
break
return JsonResponse(msg)
Expand Down Expand Up @@ -177,7 +177,7 @@ def _course_team_user(request, course_key, email):
# below will never return true.
# Remove the .has_user() call below when course roles are implemented.
elif (role.has_user(user, check_user_activation=False) or
course_permission_check(user, course_key, MANAGE_ALL_USERS_PERMISSION)): # pylint: disable=no-value-for-parameter
course_permission_check(user, MANAGE_ALL_USERS_PERMISSION, course_key)): # pylint: disable=no-value-for-parameter
# Remove the user from this old role:
old_roles.add(role)

Expand Down
2 changes: 1 addition & 1 deletion common/djangoapps/student/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ def is_user_staff_or_instructor_in_course(user, course_key):
GlobalStaff().has_user(user) or
CourseStaffRole(course_key).has_user(user) or
CourseInstructorRole(course_key).has_user(user) or
course_permission_check(user, course_key, MANAGE_STUDENTS_PERMISSION)
course_permission_check(user, MANAGE_STUDENTS_PERMISSION, course_key)
)

0 comments on commit 19c0039

Please sign in to comment.