Commit 801165b2 by Nimisha Asthagiri

Remove support for outdated ispublic field on Course Descriptor

Also remove its corresponding ACCESS_REQUIRE_STAFF_FOR_COURSE feature
flag.
parent 4133155a
...@@ -178,7 +178,6 @@ class AdvancedSettingsPage(CoursePage): ...@@ -178,7 +178,6 @@ class AdvancedSettingsPage(CoursePage):
'display_name', 'display_name',
'info_sidebar_name', 'info_sidebar_name',
'is_new', 'is_new',
'ispublic',
'issue_badges', 'issue_badges',
'max_student_enrollments_allowed', 'max_student_enrollments_allowed',
'no_grade', 'no_grade',
......
...@@ -270,17 +270,22 @@ def _can_enroll_courselike(user, courselike): ...@@ -270,17 +270,22 @@ def _can_enroll_courselike(user, courselike):
return ACCESS_DENIED return ACCESS_DENIED
def _has_access_course_desc(user, action, course): def _has_access_courselike(user, action, courselike):
""" """
Check if user has access to a course descriptor. Check if user has access to a course.
Arguments:
user (User): the user whose course access we are checking.
action (string): The action that is being checked.
courselike (CourseDescriptor or CourseOverview): The object
representing the course that the user wants to access.
Valid actions: Valid actions:
'load' -- load the courseware, see inside the course 'load' -- load the courseware, see inside the course
'load_forum' -- can load and contribute to the forums (one access level for now) 'load_forum' -- can load and contribute to the forums (one access level for now)
'load_mobile' -- can load from a mobile context 'load_mobile' -- can load from a mobile context
'enroll' -- enroll. Checks for enrollment window, 'enroll' -- enroll. Checks for enrollment window.
ACCESS_REQUIRE_STAFF_FOR_COURSE,
'see_exists' -- can see that the course exists. 'see_exists' -- can see that the course exists.
'staff' -- staff access to course. 'staff' -- staff access to course.
'see_in_catalog' -- user is able to see the course listed in the course catalog. 'see_in_catalog' -- user is able to see the course listed in the course catalog.
...@@ -303,25 +308,6 @@ def _has_access_course_desc(user, action, course): ...@@ -303,25 +308,6 @@ def _has_access_course_desc(user, action, course):
Can see if can enroll, but also if can load it: if user enrolled in a course and now Can see if can enroll, but also if can load it: if user enrolled in a course and now
it's past the enrollment period, they should still see it. it's past the enrollment period, they should still see it.
""" """
# VS[compat] -- this setting should go away once all courses have
# properly configured enrollment_start times (if course should be
# staff-only, set enrollment_start far in the future.)
if settings.FEATURES.get('ACCESS_REQUIRE_STAFF_FOR_COURSE'):
dog_stats_api.increment(
DEPRECATION_VSCOMPAT_EVENT,
tags=(
"location:has_access_course_desc_see_exists",
u"course:{}".format(course),
)
)
# if this feature is on, only allow courses that have ispublic set to be
# seen by non-staff
if course.ispublic:
debug("Allow: ACCESS_REQUIRE_STAFF_FOR_COURSE and ispublic")
return ACCESS_GRANTED
return _has_staff_access_to_descriptor(user, course, course.id)
return ACCESS_GRANTED if (can_enroll() or can_load()) else ACCESS_DENIED return ACCESS_GRANTED if (can_enroll() or can_load()) else ACCESS_DENIED
def can_see_in_catalog(): def can_see_in_catalog():
......
...@@ -153,7 +153,6 @@ class CommandsTestBase(ModuleStoreTestCase): ...@@ -153,7 +153,6 @@ class CommandsTestBase(ModuleStoreTestCase):
self.assertIn('children', element) self.assertIn('children', element)
self.assertIn('category', element) self.assertIn('category', element)
self.assertIn('inherited_metadata', element) self.assertIn('inherited_metadata', element)
self.assertIsNone(element['inherited_metadata']['ispublic'])
# ... but does not contain inherited metadata containing a default value: # ... but does not contain inherited metadata containing a default value:
self.assertNotIn('due', element['inherited_metadata']) self.assertNotIn('due', element['inherited_metadata'])
...@@ -169,7 +168,6 @@ class CommandsTestBase(ModuleStoreTestCase): ...@@ -169,7 +168,6 @@ class CommandsTestBase(ModuleStoreTestCase):
self.assertIn('children', element) self.assertIn('children', element)
self.assertIn('category', element) self.assertIn('category', element)
self.assertIn('inherited_metadata', element) self.assertIn('inherited_metadata', element)
self.assertIsNone(element['inherited_metadata']['ispublic'])
# ... and contains inherited metadata containing a default value: # ... and contains inherited metadata containing a default value:
self.assertIsNone(element['inherited_metadata']['due']) self.assertIsNone(element['inherited_metadata']['due'])
......
...@@ -65,11 +65,6 @@ class LmsBlockMixin(XBlockMixin): ...@@ -65,11 +65,6 @@ class LmsBlockMixin(XBlockMixin):
scope=Scope.settings, scope=Scope.settings,
deprecated=True deprecated=True
) )
ispublic = Boolean(
display_name=_("Course Is Public"),
help=_("Enter true or false. If true, the course is open to the public. If false, the course is open only to admins."),
scope=Scope.settings
)
visible_to_staff_only = Boolean( visible_to_staff_only = Boolean(
help=_("If true, can be seen only by course staff, regardless of start date."), help=_("If true, can be seen only by course staff, regardless of start date."),
default=False, default=False,
......
...@@ -128,7 +128,6 @@ FEATURES = { ...@@ -128,7 +128,6 @@ FEATURES = {
'DISABLE_LOGIN_BUTTON': False, # used in systems where login is automatic, eg MIT SSL 'DISABLE_LOGIN_BUTTON': False, # used in systems where login is automatic, eg MIT SSL
# extrernal access methods # extrernal access methods
'ACCESS_REQUIRE_STAFF_FOR_COURSE': False,
'AUTH_USE_OPENID': False, 'AUTH_USE_OPENID': False,
'AUTH_USE_CERTIFICATES': False, 'AUTH_USE_CERTIFICATES': False,
'AUTH_USE_OPENID_PROVIDER': False, 'AUTH_USE_OPENID_PROVIDER': False,
......
...@@ -188,7 +188,6 @@ OPEN_ENDED_GRADING_INTERFACE = { ...@@ -188,7 +188,6 @@ OPEN_ENDED_GRADING_INTERFACE = {
############################## LMS Migration ################################## ############################## LMS Migration ##################################
FEATURES['ENABLE_LMS_MIGRATION'] = True FEATURES['ENABLE_LMS_MIGRATION'] = True
FEATURES['ACCESS_REQUIRE_STAFF_FOR_COURSE'] = False # require that user be in the staff_* group to be able to enroll
FEATURES['XQA_SERVER'] = 'http://xqa:server@content-qa.edX.mit.edu/xqa' FEATURES['XQA_SERVER'] = 'http://xqa:server@content-qa.edX.mit.edu/xqa'
INSTALLED_APPS += ('lms_migration',) INSTALLED_APPS += ('lms_migration',)
......
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