Commit 52156893 by Nimisha Asthagiri

MA-1624 Unit tests for User Partition Transformer.

parent 222bdd98
...@@ -161,19 +161,21 @@ class _MergedGroupAccess(object): ...@@ -161,19 +161,21 @@ class _MergedGroupAccess(object):
for merged_parent_access in merged_parent_access_list: for merged_parent_access in merged_parent_access_list:
# pylint: disable=protected-access # pylint: disable=protected-access
if partition.id in merged_parent_access._access: if partition.id in merged_parent_access._access:
# Since this parent has group access restrictions, # Since this parent has group access
# merge it with the running list of # restrictions, merge it with the running list
# parent-introduced restrictions. # of parent-introduced restrictions.
merged_parent_group_ids.update(merged_parent_access._access[partition.id]) merged_parent_group_ids.update(merged_parent_access._access[partition.id])
else: else:
# Since at least one parent chain has no group # Since this parent chain has no group access
# access restrictions for this partition, allow # restrictions for this partition, allow
# unfettered group access or this partition. # unfettered group access for this partition
# and don't bother checking the rest of the
# parents.
merged_parent_group_ids = None merged_parent_group_ids = None
break break
# Group access for this partition as stored on the xblock # Group access for this partition as stored on the xblock
xblock_partition_access = set(xblock_group_access.get(partition.id, [])) or None xblock_partition_access = set(xblock_group_access.get(partition.id) or []) or None
# Compute this block's access by intersecting the block's # Compute this block's access by intersecting the block's
# own access with the merged access from its parent chains. # own access with the merged access from its parent chains.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment