Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
48d1dd56
Commit
48d1dd56
authored
Jan 22, 2014
by
Sef Kloninger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'edx-west/rc-20140123' of github.com:edx/edx-platform into edx-west/rc-20140123
parents
b84f71f9
be41c0f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
lms/djangoapps/courseware/access.py
+3
-5
No files found.
lms/djangoapps/courseware/access.py
View file @
48d1dd56
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment