adhocracy_core.sheets.principal module

Sheets for :term:`principal`s.

interface IUserBasic[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the basic user sheet.

class UserBasicSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Basic user sheet data structure.

This sheet must only store public information, as everyone can see it.

name: visible name

interface IUserExtended[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the extended user sheet.

class UserExtendedSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Extended user sheet data structure.

Sensitive information (not for everyone’s eyes) should be stored here.

email: email address tzname: time zone

interface IEmailNew[source]

Extends: adhocracy_core.interfaces.ISheet, adhocracy_core.interfaces.ISheetRequirePassword

Marker interface for not yet activate new user email.

class EmailNewSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

New user mail sheet data structure.

email: email address

interface IPermissions[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the permissions sheet.

interface IGroup[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the group sheet.

interface PermissionsGroupsReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

permissions sheet reference to preceding versions.

class GroupSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Group sheet data structure.

interface ICaptcha[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for user-submitted captcha data.

class CaptchaSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Wraps user-submitted captcha data.

This sheet may be required when creating a new user (if captchas are turned on), but the data is discarded after validation.

id: captcha ID (generated by Thentos) solution: solution to the captcha (entered by a human user)

validator(node, value)[source]

Validate the captcha.

If ‘adhocracy.captcha_enabled’ is true, we ask the thentos-captcha service whether the given solution is correct. If captchas are not enabled, this validator will always pass.

class CaptchaSheet(meta: adhocracy_core.interfaces.SheetMetadata, context: <InterfaceClass adhocracy_core.interfaces.IResourceSheet>, registry: pyramid.registry.Registry, request: <InterfaceClass pyramid.interfaces.IRequest>=None, creating: adhocracy_core.interfaces.ResourceMetadata=None)[source]

Bases: adhocracy_core.sheets.BaseResourceSheet

Dummy sheet that does not store any data.

get_group_choices(context, request) → [][source]

Return group choices based on the /principals/groups service.

class PermissionsSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Permissions sheet data structure.

groups: groups this user joined

class PermissionsAttributeResourceSheet(meta: adhocracy_core.interfaces.SheetMetadata, context: <InterfaceClass adhocracy_core.interfaces.IResourceSheet>, registry: pyramid.registry.Registry, request: <InterfaceClass pyramid.interfaces.IRequest>=None, creating: adhocracy_core.interfaces.ResourceMetadata=None)[source]

Bases: adhocracy_core.sheets.AttributeResourceSheet

Store the groups field references also as object attribute.

interface IPasswordAuthentication[source]

Extends: adhocracy_core.interfaces.ISheet, adhocracy_core.interfaces.ISheetRequirePassword

Marker interface for the password sheet.

class PasswordAuthenticationSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure for password based user authentication.

password: plaintext password adhocracy_core.schema.Password.

class PasswordAuthenticationSheet(meta: adhocracy_core.interfaces.SheetMetadata, context: <InterfaceClass adhocracy_core.interfaces.IResourceSheet>, registry: pyramid.registry.Registry, request: <InterfaceClass pyramid.interfaces.IRequest>=None, creating: adhocracy_core.interfaces.ResourceMetadata=None)[source]

Bases: adhocracy_core.sheets.AnnotationRessourceSheet

Sheet for password based user authentication.

The password data is encrypted and stored in the user object (context). This assures compatibility with substanced.principal.User.

The check_plaintext_password method can be used to validate passwords.

check_plaintext_password(password: str) → bool[source]

Check if password matches the stored encrypted password.

Raises:ValueError – if password is > 4096 bytes
class ActivationSetting(*arg, **kw)[source]

Bases: adhocracy_core.schema.SingleLine

Activation setting.

Possible values: direct, registration_mail, invitation_mail

default = 'registration_mail'
validator = <colander.deferred object>[source]
widget = <colander.deferred object>[source]
interface IActivationConfiguration[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the user activation configutation sheet.

class ActivationConfigutationSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure for user activation configuration.

activation: One of ‘direct’, ‘register’ or ‘invite’

interface IAnonymizeDefault[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the user anonymize default sheet.

class AnonymizeDefaultSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure for user default anonymize setting.

anonymize: Boolean setting for anonymization default .

interface IServiceKonto[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the ServiceKonto sheet.

class ServiceKontoSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure for ServiceKonto user information.

interface IServiceKontoSettings[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the ServiceKonto settings sheet.

class ServiceKontoSettingsSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure for public ServiceKonto user information.

includeme(config)[source]

Register sheets and activate catalog factory.