def create_person(person):
  """Creates a person."""
  return base_rest_service.create_obj(
      person,
      name=person.name,
      email=person.email,
      context=rest_convert.default_context())
Exemplo n.º 2
0
def create_workflow(workflow):
  """Creates workflow via REST."""
  return base_rest_service.create_obj(
      workflow,
      access_control_list=rest_convert.build_access_control_list(
          workflow, acr_mapping={"wf_members": "Workflow Member"}),
      title=workflow.title,
      context=rest_convert.default_context())
Exemplo n.º 3
0
def create_task_group(task_group):
  """Creates task group via REST."""
  return base_rest_service.create_obj(
      task_group,
      contact=rest_convert.to_basic_rest_obj(task_group.assignee),
      title=task_group.title,
      workflow=rest_convert.to_basic_rest_obj(task_group.workflow),
      context=task_group.workflow.rest_context
  )
def create_control(control):
  """Creates a control."""
  return base_rest_service.create_obj(
      control,
      title=control.title,
      access_control_list=rest_convert.build_access_control_list(control),
      assertions=[rest_convert.to_basic_rest_obj(assertion)
                  for assertion in control.assertions],
      context=rest_convert.default_context())
Exemplo n.º 5
0
def create_task_group_task(task_group_task):
  """Creates task group task via REST."""
  return base_rest_service.create_obj(
      task_group_task,
      access_control_list=rest_convert.build_access_control_list(
          task_group_task, acr_mapping={"assignees": "Task Assignees"}),
      title=task_group_task.title,
      start_date=task_group_task.start_date.isoformat(),
      end_date=task_group_task.due_date.isoformat(),
      task_group=rest_convert.to_basic_rest_obj(task_group_task.task_group),
      context=task_group_task.task_group.rest_context
  )