Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 48a360d4 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil Team

controllers/default.py: checkProcess now checks permission

Fix #3733
parent d74e6dcf
...@@ -201,7 +201,7 @@ Database.prototype = { ...@@ -201,7 +201,7 @@ Database.prototype = {
if (result.status == "COMPLETED"){ if (result.status == "COMPLETED"){
callback(result.data); callback(result.data);
}else if(result.status == "FAILED"){ }else if(result.status == "FAILED"){
console.log({"type": "flash", "msg": "process failed", "priority": 1}); console.log({"type": "flash", "msg": "process failed:" + ((typeof result.message !== 'undefined') ? result.message: ''), "priority": 1});
}else{ }else{
setTimeout(function(){ self.waitProcess(processId, interval, callback); }, interval); setTimeout(function(){ self.waitProcess(processId, interval, callback); }, interval);
} }
......
...@@ -172,8 +172,15 @@ def run_extra(): ...@@ -172,8 +172,15 @@ def run_extra():
def checkProcess(): def checkProcess():
task = db.scheduler_task[request.vars["processId"]] task = db.scheduler_task[request.vars["processId"]]
results_file = db(db.results_file.scheduler_task_id == task.id).select().first()
if task.status == "COMPLETED" :
msg = ''
sample_set_id = -1
if results_file:
sample_set_id = get_sample_set_id_from_results_file(results_file.id)
if not results_file or not auth.can_view_sample_set(sample_set_id):
msg = "You don't have access to this sample"
if sample_set_id > -1 and task.status == "COMPLETED" :
run = db( db.scheduler_run.task_id == task.id ).select()[0] run = db( db.scheduler_run.task_id == task.id ).select()[0]
res = {"success" : "true", res = {"success" : "true",
...@@ -181,9 +188,15 @@ def checkProcess(): ...@@ -181,9 +188,15 @@ def checkProcess():
"data" : run.run_result, "data" : run.run_result,
"processId" : task.id} "processId" : task.id}
else : else :
res = {"success" : "true", if len(msg) > 0:
"status" : task.status, res = {"success" : "false",
"processId" : task.id} "status" : "FAILED",
"message": msg,
"processId" : task.id}
else:
res = {"success" : "true",
"status" : task.status,
"processId" : task.id}
log.error(res) log.error(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':')) return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment