adhocracy_core.workflows package¶
Finite state machines for resources.
-
class
ACLLocalRolesState(acl: list=None, local_roles: dict=None, **kw)[source]¶ Bases:
dictWorkflow state setting acl and adding local_roles.
-
local_roles= None¶ adhocracy_core.schema.LocalRolesadded to local_roles of context.
-
-
class
ACLLocalRolesWorkflow(initial_state, type, name='', description='')[source]¶ Bases:
substanced.workflow.WorkflowWorkflow using ACLLocalRolesState to setup states.
-
update_workflow_state_acls(context: <InterfaceClass adhocracy_core.interfaces.IPool>, registry: pyramid.registry.Registry)[source]¶ Update acl of current workflow state for all resources.
-
add_workflow(registry: pyramid.registry.Registry, workflow_asset: str, name: str)[source]¶ Create and add workflow to registry.
Parameters: - registry (
Registry) – registry to register the workflow and store meta data. - workfow_asset – yaml asset file to import the workflow metadata.
The data schema is
adhocracy_core.workflows.schemas.Workflow. - name (
str) – identifier for the workflow
Raises: adhocracy_core.exceptions.ConfigurationError – if the validation for cstruct or the sanity checks in class:substanced.workflow.Workflow fail.
- registry (
-
add_workflow_directive(config, workflow: str, name: str)[source]¶ Create add_workflow pyramid config directive.
Example usage:
config.add_workflow('mypackage:myworkflow.yaml', 'myworkflow)
-
transition_to_states(context, states: [<class 'str'>], registry: pyramid.registry.Registry, reset=False)[source]¶ Initialize workflow if needed and do transitions to the given states.
Raises: substanced.workflow.WorkflowError – if transition is missing to do transitions to states.
-
match_permission(acm, state, permission)[source]¶ Create a function matching a permission in an ACM.
The function can be used as matcher with the transform function of pyrsistent when transforming an existing ACM to select a specific permission to change.
Submodules¶
- adhocracy_core.workflows.badge_assignment module
- adhocracy_core.workflows.debate module
- adhocracy_core.workflows.debate_private module
- adhocracy_core.workflows.sample module
- adhocracy_core.workflows.schemas module
- adhocracy_core.workflows.standard module
- adhocracy_core.workflows.standard_private module
- adhocracy_core.workflows.subscriber module