diff --git a/lms/djangoapps/instructor/access.py b/lms/djangoapps/instructor/access.py index b95b5b7c19..4e5bbf4ce2 100644 --- a/lms/djangoapps/instructor/access.py +++ b/lms/djangoapps/instructor/access.py @@ -10,7 +10,7 @@ TODO sync instructor and staff flags """ from django.contrib.auth.models import User, Group -from courseware.access import get_access_group_name +from courseware.access import get_access_group_name, course_beta_test_group_name from django_comment_common.models import (Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, @@ -29,7 +29,7 @@ def allow_access(course, user, level): """ Allow user access to course modification. - level is one of ['instructor', 'staff'] + level is one of ['instructor', 'staff', 'beta'] """ _change_access(course, user, level, 'allow') @@ -38,7 +38,7 @@ def revoke_access(course, user, level): """ Revoke access from user to course modification. - level is one of ['instructor', 'staff'] + level is one of ['instructor', 'staff', 'beta'] """ _change_access(course, user, level, 'revoke') @@ -47,10 +47,14 @@ def _change_access(course, user, level, mode): """ Change access of user. - level is one of ['instructor', 'staff'] + level is one of ['instructor', 'staff', 'beta'] mode is one of ['allow', 'revoke'] """ - grpname = get_access_group_name(course, level) + + if level in ['beta']: + grpname = course_beta_test_group_name(course) + else: + grpname = get_access_group_name(course, level) group, _ = Group.objects.get_or_create(name=grpname) if mode == 'allow': diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index a435807adc..2f7904f92f 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -61,7 +61,7 @@ def access_allow_revoke(request, course_id): Query parameters: email is the target users email - rolename is one of ['instructor', 'staff'] + rolename is one of ['instructor', 'staff', 'beta'] mode is one of ['allow', 'revoke'] """ course = get_course_with_access(request.user, course_id, 'instructor', depth=None) @@ -88,18 +88,18 @@ def access_allow_revoke(request, course_id): @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) -def list_instructors_staff(request, course_id): +def list_course_role_members(request, course_id): """ List instructors and staff. Requires staff access. - rolename is one of ['instructor', 'staff'] + rolename is one of ['instructor', 'staff', 'beta'] """ course = get_course_with_access(request.user, course_id, 'staff', depth=None) rolename = request.GET.get('rolename', '') - if not rolename in ['instructor', 'staff']: + if not rolename in ['instructor', 'staff', 'beta']: return HttpResponseBadRequest() def extract_user_info(user): diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index a3ad6462cd..475d41e8f4 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -107,7 +107,7 @@ def _section_membership(course_id): 'section_display_name': 'Membership', 'enroll_button_url': reverse('enroll_unenroll', kwargs={'course_id': course_id}), 'unenroll_button_url': reverse('enroll_unenroll', kwargs={'course_id': course_id}), - 'list_instructors_staff_url': reverse('list_instructors_staff', kwargs={'course_id': course_id}), + 'list_course_role_members_url': reverse('list_course_role_members', kwargs={'course_id': course_id}), 'access_allow_revoke_url': reverse('access_allow_revoke', kwargs={'course_id': course_id}), 'list_forum_members_url': reverse('list_forum_members', kwargs={'course_id': course_id}), 'update_forum_role_membership_url': reverse('update_forum_role_membership', kwargs={'course_id': course_id}), diff --git a/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee b/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee index b2039b7648..fb5bd3f4bb 100644 --- a/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee +++ b/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee @@ -3,7 +3,6 @@ log = -> console.log.apply console, arguments plantTimeout = (ms, cb) -> setTimeout cb, ms - CSS_INSTRUCTOR_CONTENT = 'instructor-dashboard-content-2' CSS_ACTIVE_SECTION = 'active-section' CSS_IDASH_SECTION = 'idash-section' diff --git a/lms/urls.py b/lms/urls.py index 0d5076ec4a..5834574185 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -257,8 +257,8 @@ if settings.COURSEWARE_ENABLED: # api endpoints for instructor url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/enroll_unenroll$', 'instructor.views.api.enroll_unenroll', name="enroll_unenroll"), - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/list_instructors_staff$', - 'instructor.views.api.list_instructors_staff', name="list_instructors_staff"), + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/list_course_role_members$', + 'instructor.views.api.list_course_role_members', name="list_course_role_members"), url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/access_allow_revoke$', 'instructor.views.api.access_allow_revoke', name="access_allow_revoke"), url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/grading_config$',