interfaces
- ptah.interfaces.resolver(uri)¶
Resolve uri to object.
Parameters: uri – Uri string Return type: Resolved object
- class ptah.interfaces.Principal¶
Principal interface
- __uri__¶
Principal uri
- name¶
Principal name
- login¶
Principal login
- ptah.interfaces.auth_checker(info)¶
Perform additional checks on principal during authentication process.
Parameters: info – A instance of ptah.interfaces.AuthInfo class
- ptah.interfaces.principal_searcher(term)¶
Search users by term
Parameters: term – search term (str) Return type: iterator of ptah.interfaces.Principal instances
- class ptah.interfaces.AuthInfo¶
Authentication information
- __uri__¶
Principal uri or None if principal is not set
- principal¶
ptah.interfaces.Principal object
- status¶
Status, True is principal has been authenticated, false otherwise
- message¶
Readable message from auth checkers
- class ptah.interfaces.AuthProvider¶
Authentication provider interface
- authenticate(credentials)¶
Authenticate credentials, return ptah.interfaces.Principal object or None
- get_principal_bylogin(login)¶
return instance of ptah.interfaces.Principal of None
- class ptah.authentication.Authentication¶
Ptah authentication utility
- authenticate(credentials)¶
Authenticate credentials.
Parameters: credentials – Dictionary with login and password Return type: ptah.authentication.AuthInfo
- authenticate_principal(principal)¶
Authenticate principal, check principal with auth checkers
Parameters: principal – Principal object Return type: ptah.authentication.AuthInfo
- get_current_principal()¶
Resolve and return current user uri
- get_effective_userid()¶
Return effective user uri, of current user uri.
- get_principal_bylogin(login)¶
Return principal by login
- get_userid()¶
Get current user id. By default it uses pyramid.security.authenticated_userid
- set_effective_userid(uri)¶
Set effective user uri
- set_userid(uri)¶
Set current user id
- class ptah.interfaces.IACLsAware¶
acl maps aware context
- ptah.interfaces.populate_step(registry)¶
Populate data step.
Parameters: registry – Pyramid pyramid.registry.Registry object
Form and Field Interfaces
- ptah.form.interfaces.Validator(field, value)¶
A validator is called during field value validation.
If value is not valid, raise a ptah.form.Invalid instance as an exception after.
field is a ptah.form.Field instance, for use when raising a ptah.form.Invalid exception.
- ptah.form.interfaces.Preview(request)¶
A preview is called by Field types management module.
Parameters: request – Pyramid request object Return type: Html snippet
- ptah.form.interfaces.VocabularyFactory(context)¶
ptah.form.fields.VocabularyField instantiate vocabulary during field binding process.
Parameters: context – Field context Return type: Vocabulary instance