Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
562322d7
Commit
562322d7
authored
7 years ago
by
Eric Fischer
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15673 from edx/efischer/actually_limit_libraries
Return no libraries if org not specified
parents
bfb17a76
2ab2ed77
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/djangoapps/contentstore/views/course.py
+8
-2
8 additions, 2 deletions
cms/djangoapps/contentstore/views/course.py
with
8 additions
and
2 deletions
cms/djangoapps/contentstore/views/course.py
+
8
−
2
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment