Properly set permissions on tools that create new datasets in their post job hooks (this is deprecated).

This commit is contained in:
Daniel Blankenberg
2008-08-06 15:41:38 -04:00
parent 32cb3c5341
commit c546f50963
3 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -5,7 +5,8 @@ from shutil import copyfile
#post processing, set build for data and add additional data to history
def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
history = out_data.items()[0][1].history
base_dataset = out_data.items()[0][1]
history = base_dataset.history
if history == None:
print "unknown history!"
return
@@ -37,6 +38,8 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr
newdata.extension = file_type
newdata.name = basic_name + " (" + description + ")"
history.add_dataset( newdata )
app.security_agent.set_dataset_groups( newdata.dataset, base_dataset.dataset.groups )
app.security_agent.set_dataset_roles( newdata.dataset, base_dataset.dataset.roles )
app.model.flush()
try:
copyfile(filepath,newdata.file_name)