core.modules.moduleconf

Module Contents

Classes

ModuleConfScriptSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a

ModuleConfSkel

This is a container-object holding information about one database entity.

ModuleConf

This module is for ViUR internal purposes only.

Attributes

MODULECONF_KINDNAME

core.modules.moduleconf.MODULECONF_KINDNAME = 'viur-module-conf'
class core.modules.moduleconf.ModuleConfScriptSkel

Bases: 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 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 OrderedDict-Instance, so the definition order of the contained bones remains constant.

name
icon
capable
access
class core.modules.moduleconf.ModuleConfSkel(*args, **kwargs)

Bases: 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 OrderedDict-Instance, so the definition order of the contained bones remains constant.

Variables:
  • key (server.bones.BaseBone) – 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.

  • creationdate (server.bones.DateBone) – The date and time where this entity has been created.

  • changedate (server.bones.DateBone) – The date and time of the last change to this entity.

kindName
_valid_tags = ['b', 'a', 'i', 'u', 'span', 'div', 'p', 'ol', 'ul', 'li', 'abbr', 'sub', 'sup', 'h1', 'h2',...
_valid_html
name
help_text
help_text_add
help_text_edit
scripts
class core.modules.moduleconf.ModuleConf(moduleName, modulePath, *args, **kwargs)

Bases: 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.

Parameters:
  • moduleName (str) –

  • modulePath (str) –

MODULES
kindName
accessRights = ['edit']
adminInfo()
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.

See also

add()

Returns:

True, if adding entries is allowed, False otherwise.

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.

Parameters:

skel – The Skeleton that should be deleted.

See also

delete()

Returns:

True, if deleting entries is allowed, False otherwise.

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.

See also

edit()

Parameters:

skel – The Skeleton that should be edited.

Returns:

True, if editing entries is allowed, False otherwise.

listFilter(query)

Access control function on item listing.

This function is invoked by the 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.

Parameters:

query – Query which should be altered.

Returns:

The altered filter, or None if access is not granted.

classmethod get_by_module_name(module_name)
Parameters:

module_name (str) –

Return type:

None | viur.core.skeleton.SkeletonInstance

static read_all_modules()