Application Configuration

guillotina handles configuration application customizations and extension mostly with decorators in code.

This page is meant to be a reference to the available decorators and options to those decorators.

service

@configure.service

  • context: Content type interface this service is registered against. Example: IContainer: required
  • method: HTTP method this service works against. Default is GET
  • permission: Permission this service requires. Default is configure default_permission setting
  • layer: Layer this service is registered for. Default is IDefaultLayer
  • name: This is used as part of the uri. Example @foobar -> /mycontent/@foobar. Leave empty to be used for base uri of content -> /mycontent.

content type

@configure.contenttype

  • type_name: Name of the content type: required
  • schema: Interface schema to use for type: required
  • add_permission: Permission required to add content. Defaults to guillotina.AddContent
  • allowed_types: List of types allowed to be added inside this content assuming it is a Folder type. Defaults to allowing all types.

behavior

@configure.behavior

  • title: Name of behavior
  • provides: Interface this behavior provides
  • marker: Marker interface to apply to utilized instance's behavior
  • for_: Content type this behavior is available for

addon

@configure.addon

  • name: required
  • title: required

adapter

@configure.adapter

  • for_: Type or list of types this adapter adapts: required
  • provides: Interface this adapter provides: required
  • name: Your adapter can be named to be looked up by name
  • factory: To use without decorator syntax, this allows you to register adapter of class defined elsewhere

subscriber

@configure.subscriber

  • for_: Type or list of types this subscriber is for: required
  • handler: A callable object that handles event, this allows you to register subscriber handler defined elsewhere
  • factory: A factory used to create the subscriber instance
  • provides: Interface this adapter provides--must be used along with factory

utility

@configure.utility

  • provides: Interface this utility provides
  • name: Name of utility
  • factory: A factory used to create the subscriber instance

permission

configure.permission

  • id
  • title
  • description

role

configure.role

  • id
  • title
  • description

grant

configure.grant

  • role: ID of role
  • principal: ID of principal to grant to
  • permission: ID of permission to grant
  • permissions: List of permission IDs to grant to

grant_all

configure.grant_all

  • principal: ID of principal
  • role: ID of role

Overriding Configuration

guillotina applications can override default guillotina configuration.

If multiple guillotina applications configure conflicting configurations, guillotina chooses the configuration according to the order the guillotina applications that are included.