def checkHasTaskEditableStatus(self):
    """Checks whether the task is in one of the editable states.

    We specifically do not allow editing of tasks which are already claimed.
    """
    if not task_logic.hasTaskEditableStatus(self.data.task):
      raise exception.Forbidden(message=DEF_TASK_UNEDITABLE_STATUS)
Exemple #2
0
  def checkAccess(self, data, check, mutator):
    mutator.taskFromKwargsIfId()

    check.isLoggedIn()

    assert access_checker.isSet(data.task)

    if data.task:
      check.checkCanUserEditTask()
      check.checkTimelineAllowsTaskEditing()

      # Set full_edit status depending on the task status
      mutator.fullEdit(task_logic.hasTaskEditableStatus(data.task))
    else:
      check.canCreateTask()
Exemple #3
0
    def checkAccess(self, data, check, mutator):
        mutator.taskFromKwargsIfId()

        check.isLoggedIn()

        assert access_checker.isSet(data.task)

        if data.task:
            check.checkCanUserEditTask()
            check.checkTimelineAllowsTaskEditing()

            # Set full_edit status depending on the task status
            mutator.fullEdit(task_logic.hasTaskEditableStatus(data.task))
        else:
            check.canCreateTask()