def access_write_task(original_requester, key=None):
"""
Determine whether a requester can write to a task or its runs.
"""
requester = request.remote_addr
# Local interfaces are always okay.
if requester in local_ips:
return True
# Tasks without keys are limited to the original requester only
if key is None:
return requester == original_requester
# Beyond here, the task has a key.
request_key = arg_string("key")
return (request_key is not None) and (request_key == key)
评论列表
文章目录