From 04bc696661cdc07ac509d686132fd2b646ba2a50 Mon Sep 17 00:00:00 2001 From: Sid Verma Date: Mon, 22 Jun 2020 12:45:28 +0530 Subject: [PATCH] Fix wrong field name in ManyRelation --- openedx/core/djangoapps/content_libraries/permissions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openedx/core/djangoapps/content_libraries/permissions.py b/openedx/core/djangoapps/content_libraries/permissions.py index 02f8e2a561..e8d3261ee6 100644 --- a/openedx/core/djangoapps/content_libraries/permissions.py +++ b/openedx/core/djangoapps/content_libraries/permissions.py @@ -17,7 +17,7 @@ is_global_staff = is_user_active & rules.is_staff # Does the user have at least read permission for the specified library? has_explicit_read_permission_for_library = ( ManyRelation( - 'contentlibrarypermission', + 'permission_grants', (Attribute('user', lambda user: user) | Relation('group', in_current_groups)) ) # We don't check 'access_level' here because all access levels grant read permission @@ -25,7 +25,7 @@ has_explicit_read_permission_for_library = ( # Does the user have at least author permission for the specified library? has_explicit_author_permission_for_library = ( ManyRelation( - 'contentlibrarypermission', + 'permission_grants', (Attribute('user', lambda user: user) | Relation('group', in_current_groups)) & ( Attribute('access_level', ContentLibraryPermission.AUTHOR_LEVEL) | Attribute('access_level', ContentLibraryPermission.ADMIN_LEVEL) @@ -35,7 +35,7 @@ has_explicit_author_permission_for_library = ( # Does the user have admin permission for the specified library? has_explicit_admin_permission_for_library = ( ManyRelation( - 'contentlibrarypermission', + 'permission_grants', (Attribute('user', lambda user: user) | Relation('group', in_current_groups)) & Attribute('access_level', ContentLibraryPermission.ADMIN_LEVEL) )