remove staff exemption from the library_content transformer
This commit is contained in:
@@ -26,7 +26,7 @@ class ContentLibraryTransformer(FilteringTransformerMixin, BlockStructureTransfo
|
||||
blocks within a library_content module to which a user should not
|
||||
have access.
|
||||
|
||||
Staff users are to exempted from library content pathways.
|
||||
Staff users are not to be exempted from library content pathways.
|
||||
"""
|
||||
WRITE_VERSION = 1
|
||||
READ_VERSION = 1
|
||||
@@ -127,10 +127,8 @@ class ContentLibraryTransformer(FilteringTransformerMixin, BlockStructureTransfo
|
||||
Return True if selected block should be removed.
|
||||
|
||||
Block is removed if it is part of library_content, but has
|
||||
not been selected for current user, with staff as an exemption.
|
||||
not been selected for current user.
|
||||
"""
|
||||
if usage_info.has_staff_access:
|
||||
return False
|
||||
if block_key not in all_library_children:
|
||||
return False
|
||||
if block_key in all_selected_children:
|
||||
|
||||
@@ -168,19 +168,3 @@ class ContentLibraryTransformerTestCase(CourseStructureTestCase):
|
||||
),
|
||||
u"Expected 'selected' equality failed in iteration {}.".format(i)
|
||||
)
|
||||
|
||||
def test_staff_access_to_library_content(self):
|
||||
"""
|
||||
To verify that staff member has access to all the library content blocks.
|
||||
|
||||
Scenario: Given a staff member in a course with library content
|
||||
when data is transformed by LibraryContentTransformer
|
||||
none of the unassigned block is removed from the access list
|
||||
and staff member will have access to all the blocks
|
||||
"""
|
||||
transformed_blocks = get_course_blocks(
|
||||
self.staff,
|
||||
self.course.location,
|
||||
transformers=self.transformers
|
||||
)
|
||||
self.assertEqual(len(list(transformed_blocks.get_block_keys())), len(self.blocks))
|
||||
|
||||
Reference in New Issue
Block a user