Commit 48d1dd56 by Sef Kloninger

Merge branch 'edx-west/rc-20140123' of github.com:edx/edx-platform into edx-west/rc-20140123

parents b84f71f9 be41c0f7
...@@ -288,9 +288,6 @@ def _has_access_descriptor(user, descriptor, action, course_context=None): ...@@ -288,9 +288,6 @@ def _has_access_descriptor(user, descriptor, action, course_context=None):
students to see modules. If not, views should check the course, so we students to see modules. If not, views should check the course, so we
don't have to hit the enrollments table on every module load. don't have to hit the enrollments table on every module load.
""" """
# nonregistered users shouldn't be able to access certain descriptor types
if not UserProfile.has_registered(user):
return _can_load_descriptor_nonregistered(descriptor)
# If start dates are off, can always load # If start dates are off, can always load
if settings.FEATURES['DISABLE_START_DATES'] and not is_masquerading_as_student(user): if settings.FEATURES['DISABLE_START_DATES'] and not is_masquerading_as_student(user):
...@@ -306,9 +303,10 @@ def _has_access_descriptor(user, descriptor, action, course_context=None): ...@@ -306,9 +303,10 @@ def _has_access_descriptor(user, descriptor, action, course_context=None):
course_context=course_context course_context=course_context
) )
if now > effective_start: if now > effective_start:
# after start date, everyone can see it # after start date, all registered users can see it
# nonregistered users shouldn't be able to access certain descriptor types
debug("Allow: now > effective start date") debug("Allow: now > effective start date")
return True return UserProfile.has_registered(user) or _can_load_descriptor_nonregistered(descriptor)
# otherwise, need staff access # otherwise, need staff access
return _has_staff_access_to_descriptor(user, descriptor, course_context) return _has_staff_access_to_descriptor(user, descriptor, course_context)
......
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