Permissions

class cms.models.permissionmodels.AbstractPagePermission(*args, **kwargs)

Bases: Model

Abstract page permissions

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

property audience

Return audience by priority, so: All or User, Group

class cms.models.permissionmodels.PagePermission(*args, **kwargs)

Bases: AbstractPagePermission

Page permissions for a single page

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

class cms.models.permissionmodels.GlobalPagePermission(*args, **kwargs)

Bases: AbstractPagePermission

Permissions for all pages (global).

cms.models.permissionmodels.ACCESS_PAGE = 1

Access to the page itself

cms.models.permissionmodels.ACCESS_CHILDREN = 2

Access to immediate children (1 level)

cms.models.permissionmodels.ACCESS_DESCENDANTS = 4

Access to all children (first level and also their children)

cms.models.permissionmodels.ACCESS_PAGE_AND_DESCENDANTS = 5

Access to page itself and all children (first level and also their children)