def create_job( job: JobBase, dao: Dao = Depends(get_dao), auth: authorization.Rules = Depends(get_rules), ): """create a new job""" user = auth.assert_user() auth.assert_jobs() new_job = dao.create_job(user, job.manifest, job.items_spec) return new_job
def create_job( job: JobBase, dao: Dao = Depends(get_dao), auth: authorization.Rules = Depends(get_rules), ): """create a new job""" user = auth.assert_user() # only admins can create jobs through /jobs API auth.assert_jobs(None) new_job = dao.create_job(user, job) return new_job