diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index aa7421bb87b3..a5e3b575e3f8 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -299,8 +299,14 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): if selected_groups_label: selected_groups_label = _('Access restricted to: {list_of_groups}').format(list_of_groups=selected_groups_label) # lint-amnesty, pylint: disable=line-too-long course = modulestore().get_course(xblock.location.course_key) - can_edit = context.get('can_edit', True) - can_add = context.get('can_add', True) + + if root_xblock and root_xblock.upstream and str(root_xblock.upstream).startswith('lct:'): + can_edit = False + can_add = False + else: + can_edit = context.get('can_edit', True) + can_add = context.get('can_add', True) + # Is this a course or a library? is_course = xblock.context_key.is_course tags_count_map = context.get('tags_count_map') @@ -315,7 +321,7 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): 'is_root': is_root, 'is_reorderable': is_reorderable, 'can_edit': can_edit, - 'can_edit_visibility': context.get('can_edit_visibility', is_course), + 'can_edit_visibility': can_edit and context.get('can_edit_visibility', is_course), 'course_authoring_url': settings.COURSE_AUTHORING_MICROFRONTEND_URL, 'is_loading': context.get('is_loading', False), 'is_selected': context.get('is_selected', False), diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 8f4090588613..c705c2e6adf5 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -211,12 +211,13 @@ % endif - % elif not show_inline: -
  • - - ${_("Details")} - -
  • + % if not show_inline: +
  • + + ${_("Details")} + +
  • + % endif % endif % endif