Commit 1d4defd0 by David Ormsbee

Fix bug where we weren't combining org_staff with built-in staff for group checking

parent bfe2809a
...@@ -382,7 +382,7 @@ def group_names_for(role, location, course_context=None): ...@@ -382,7 +382,7 @@ def group_names_for(role, location, course_context=None):
group_name = '{0}_{1}'.format(role, course_id) group_name = '{0}_{1}'.format(role, course_id)
return group_name, legacy_group_name return [group_name, legacy_group_name]
group_names_for_staff = partial(group_names_for, 'staff') group_names_for_staff = partial(group_names_for, 'staff')
group_names_for_instructor = partial(group_names_for, 'instructor') group_names_for_instructor = partial(group_names_for, 'instructor')
...@@ -552,7 +552,7 @@ def _has_access_to_location(user, location, access_level, course_context): ...@@ -552,7 +552,7 @@ def _has_access_to_location(user, location, access_level, course_context):
if access_level == 'staff': if access_level == 'staff':
staff_groups = group_names_for_staff(location, course_context) + \ staff_groups = group_names_for_staff(location, course_context) + \
_course_org_staff_group_name(location, course_context) [_course_org_staff_group_name(location, course_context)]
for staff_group in staff_groups: for staff_group in staff_groups:
if staff_group in user_groups: if staff_group in user_groups:
debug("Allow: user in group %s", staff_group) debug("Allow: user in group %s", staff_group)
...@@ -561,7 +561,7 @@ def _has_access_to_location(user, location, access_level, course_context): ...@@ -561,7 +561,7 @@ def _has_access_to_location(user, location, access_level, course_context):
if access_level == 'instructor' or access_level == 'staff': # instructors get staff privileges if access_level == 'instructor' or access_level == 'staff': # instructors get staff privileges
instructor_groups = group_names_for_instructor(location, course_context) + \ instructor_groups = group_names_for_instructor(location, course_context) + \
_course_org_instructor_group_name(location, course_context) [_course_org_instructor_group_name(location, course_context)]
for instructor_group in instructor_groups: for instructor_group in instructor_groups:
if instructor_group in user_groups: if instructor_group in user_groups:
debug("Allow: user in group %s", instructor_group) debug("Allow: user in group %s", instructor_group)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment