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
e4fb9ec6
Commit
e4fb9ec6
authored
Aug 14, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove is_staff from ModuleSystem
- now handling access control via get_module
parent
b782e2ff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
cms/djangoapps/contentstore/views.py
+0
-3
common/lib/xmodule/xmodule/tests/__init__.py
+2
-3
common/lib/xmodule/xmodule/x_module.py
+3
-7
lms/djangoapps/courseware/module_render.py
+0
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
e4fb9ec6
...
...
@@ -215,9 +215,6 @@ def preview_module_system(request, preview_id, descriptor):
render_template
=
render_from_lms
,
debug
=
True
,
replace_urls
=
replace_urls
,
# TODO (vshnayder): All CMS users get staff view by default
# is that what we want?
is_staff
=
True
,
)
...
...
common/lib/xmodule/xmodule/tests/__init__.py
View file @
e4fb9ec6
...
...
@@ -35,7 +35,6 @@ i4xs = ModuleSystem(
filestore
=
fs
.
osfs
.
OSFS
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"/test_files"
),
debug
=
True
,
xqueue
=
{
'interface'
:
None
,
'callback_url'
:
'/'
,
'default_queuename'
:
'testqueue'
},
is_staff
=
False
,
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
)
)
...
...
@@ -336,7 +335,7 @@ class CodeResponseTest(unittest.TestCase):
self
.
assertFalse
(
test_lcp
.
correct_map
.
is_queued
(
answer_ids
[
j
]))
# Should be dequeued, message delivered
else
:
self
.
assertTrue
(
test_lcp
.
correct_map
.
is_queued
(
answer_ids
[
j
]))
# Should be queued, message undelivered
def
test_convert_files_to_filenames
(
self
):
problem_file
=
os
.
path
.
dirname
(
__file__
)
+
"/test_files/coderesponse.xml"
fp
=
open
(
problem_file
)
...
...
@@ -347,7 +346,7 @@ class CodeResponseTest(unittest.TestCase):
self
.
assertEquals
(
answers_converted
[
'1_2_1'
],
'String-based answer'
)
self
.
assertEquals
(
answers_converted
[
'1_3_1'
],
[
'answer1'
,
'answer2'
,
'answer3'
])
self
.
assertEquals
(
answers_converted
[
'1_4_1'
],
fp
.
name
)
class
ChoiceResponseTest
(
unittest
.
TestCase
):
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
e4fb9ec6
...
...
@@ -612,8 +612,9 @@ class XModuleDescriptor(Plugin, HTMLSnippet):
def
_try_parse_time
(
self
,
key
):
"""
Parse an optional metadata key containing a time: if present, must be valid.
Return None if not present.
Parse an optional metadata key containing a time: if present, complain
if it doesn't parse.
Return None if not present or invalid.
"""
if
key
in
self
.
metadata
:
try
:
...
...
@@ -704,7 +705,6 @@ class ModuleSystem(object):
filestore
=
None
,
debug
=
False
,
xqueue
=
None
,
is_staff
=
False
,
node_path
=
""
):
'''
Create a closure around the system environment.
...
...
@@ -735,9 +735,6 @@ class ModuleSystem(object):
replace_urls - TEMPORARY - A function like static_replace.replace_urls
that capa_module can use to fix up the static urls in
ajax results.
is_staff - Is the user making the request a staff user?
TODO (vshnayder): this will need to change once we have real user roles.
'''
self
.
ajax_url
=
ajax_url
self
.
xqueue
=
xqueue
...
...
@@ -748,7 +745,6 @@ class ModuleSystem(object):
self
.
DEBUG
=
self
.
debug
=
debug
self
.
seed
=
user
.
id
if
user
is
not
None
else
0
self
.
replace_urls
=
replace_urls
self
.
is_staff
=
is_staff
self
.
node_path
=
node_path
def
get
(
self
,
attr
):
...
...
lms/djangoapps/courseware/module_render.py
View file @
e4fb9ec6
...
...
@@ -221,7 +221,6 @@ def get_module(user, request, location, student_module_cache, position=None):
# a module is coming through get_html and is therefore covered
# by the replace_static_urls code below
replace_urls
=
replace_urls
,
is_staff
=
has_access
(
user
,
location
,
'staff'
),
node_path
=
settings
.
NODE_PATH
)
# pass position specified in URL to module through ModuleSystem
...
...
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