'Get a workflow (non-stored) from a encoded workflow id and
make sure it accessible to the user.'

def get_owned_workflow(self, trans, encoded_workflow_id):

    workflow_id = decode_id(self.app, encoded_workflow_id)
    workflow = trans.sa_session.query(model.Workflow).get(workflow_id)
    self.check_security(trans, workflow, check_ownership=True)
    return workflow
