:py:mod:`core.modules.moduleconf` ================================= .. py:module:: core.modules.moduleconf Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: core.modules.moduleconf.ModuleConfScriptSkel core.modules.moduleconf.ModuleConfSkel core.modules.moduleconf.ModuleConf Attributes ~~~~~~~~~~ .. autoapisummary:: core.modules.moduleconf.MODULECONF_KINDNAME .. py:data:: MODULECONF_KINDNAME :value: 'viur-module-conf' .. py:class:: ModuleConfScriptSkel Bases: :py:obj:`viur.core.skeleton.RelSkel` This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for :class:`~viur.core.bones.extendedRelationalBone.extendedRelationalBone`. It needs to be sub-classed where information about the kindName and its attributes (bones) are specified. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. .. py:attribute:: name .. py:attribute:: icon .. py:attribute:: capable .. py:attribute:: access .. py:class:: ModuleConfSkel(*args, **kwargs) Bases: :py:obj:`viur.core.skeleton.Skeleton` This is a container-object holding information about one database entity. It has to be sub-classed with individual information about the kindName of the entities and its specific data attributes, the so called bones. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. :ivar key: This bone stores the current database key of this entity. Assigning to this bones value is dangerous and does *not* affect the actual key its stored in. :vartype key: server.bones.BaseBone :ivar creationdate: The date and time where this entity has been created. :vartype creationdate: server.bones.DateBone :ivar changedate: The date and time of the last change to this entity. :vartype changedate: server.bones.DateBone .. py:attribute:: kindName .. py:attribute:: _valid_tags :value: ['b', 'a', 'i', 'u', 'span', 'div', 'p', 'ol', 'ul', 'li', 'abbr', 'sub', 'sup', 'h1', 'h2',... .. py:attribute:: _valid_html .. py:attribute:: name .. py:attribute:: help_text .. py:attribute:: help_text_add .. py:attribute:: help_text_edit .. py:attribute:: scripts .. py:class:: ModuleConf(*args, **kwargs) Bases: :py:obj:`viur.core.prototypes.List` This module is for ViUR internal purposes only. It lists all other modules to be able to provide them with help texts. .. py:attribute:: MODULES .. py:attribute:: kindName .. py:attribute:: accessRights :value: ['edit'] .. py:attribute:: default_order .. py:method:: adminInfo() .. py:method:: canAdd() Access control function for adding permission. Checks if the current user has the permission to add a new entry. The default behavior is: - If no user is logged in, adding is generally refused. - If the user has "root" access, adding is generally allowed. - If the user has the modules "add" permission (module-add) enabled, adding is allowed. It should be overridden for a module-specific behavior. .. seealso:: :func:`add` :returns: True, if adding entries is allowed, False otherwise. .. py:method:: canDelete(skel) Access control function for delete permission. Checks if the current user has the permission to delete an entry. The default behavior is: - If no user is logged in, deleting is generally refused. - If the user has "root" access, deleting is generally allowed. - If the user has the modules "deleting" permission (module-delete) enabled, deleting is allowed. It should be overridden for a module-specific behavior. :param skel: The Skeleton that should be deleted. .. seealso:: :func:`delete` :returns: True, if deleting entries is allowed, False otherwise. .. py:method:: canEdit(skel) Access control function for modification permission. Checks if the current user has the permission to edit an entry. The default behavior is: - If no user is logged in, editing is generally refused. - If the user has "root" access, editing is generally allowed. - If the user has the modules "edit" permission (module-edit) enabled, editing is allowed. It should be overridden for a module-specific behavior. .. seealso:: :func:`edit` :param skel: The Skeleton that should be edited. :returns: True, if editing entries is allowed, False otherwise. .. py:method:: listFilter(query) Access control function on item listing. This function is invoked by the :func:`list` renderer and the related Jinja2 fetching function, and is used to modify the provided filter parameter to match only items that the current user is allowed to see. :param query: Query which should be altered. :returns: The altered filter, or None if access is not granted. .. py:method:: get_by_module_name(module_name) :classmethod: .. py:method:: read_all_modules() :staticmethod: