openedx.core.lib.license package#

Submodules#

openedx.core.lib.license.mixin module#

License mixin for XBlocks and XModules

class openedx.core.lib.license.mixin.LicenseMixin(scope_ids, field_data=None, *, runtime, **kwargs)#

Bases: XBlockMixin

Mixin that allows an author to indicate a license on the contents of an XBlock. For example, a video could be marked as Creative Commons SA-BY licensed. You can even indicate the license on an entire course.

If this mixin is not applied to an XBlock, or if the license field is blank, then the content is subject to whatever legal licensing terms that apply to content by default. For example, in the United States, that content is exclusively owned by the creator of the content by default. Other countries may have similar laws.

add_license_to_xml(node, default=None)#

When generating XML from an XBlock, this method will add the XBlock’s license to the XML representation before it is serialized. It is defined here so that classes that use this mixin can simply refer to this method, rather than reimplementing it in their XML export functions.

license#

A field class for representing a string.

The value, as loaded or enforced, can either be None or a basestring instance.

classmethod parse_license_from_xml(definition, node)#

When importing an XBlock from XML, this method will parse the license information out of the XML and attach it to the block. It is defined here so that classes that use this mixin can simply refer to this method, rather than reimplementing it in their XML import functions.

openedx.core.lib.license.wrapper module#

Code to wrap web fragments with a license.

openedx.core.lib.license.wrapper.wrap_with_license(block, view, frag, context, mako_service)#

In the LMS, display the custom license underneath the XBlock.

Module contents#