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
562322d7
Commit
562322d7
authored
Jul 26, 2017
by
Eric Fischer
Committed by
GitHub
Jul 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15673 from edx/efischer/actually_limit_libraries
Return no libraries if org not specified
parents
bfb17a76
2ab2ed77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
cms/djangoapps/contentstore/views/course.py
+8
-2
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
562322d7
...
...
@@ -464,10 +464,16 @@ def _accessible_libraries_iter(user, org=None):
"""
List all libraries available to the logged in user by iterating through all libraries.
If 'org' is present, only libraries from that org will be returned.
org (string): if not None, this value will limit the libraries returned. An empty
string will result in no libraries, and otherwise only libraries with the
specified org will be returned. The default value is None.
"""
if
org
is
not
None
:
libraries
=
[]
if
org
==
''
else
modulestore
()
.
get_libraries
(
org
=
org
)
else
:
libraries
=
modulestore
()
.
get_libraries
()
# No need to worry about ErrorDescriptors - split's get_libraries() never returns them.
return
(
lib
for
lib
in
modulestore
()
.
get_libraries
(
org
=
org
)
if
has_studio_read_access
(
user
,
lib
.
location
.
library_key
))
return
(
lib
for
lib
in
libraries
if
has_studio_read_access
(
user
,
lib
.
location
.
library_key
))
@login_required
...
...
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