mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Add back checks about can user export CSV/TSV.
Thanks to marc1006 and xet7 ! Related #3173
This commit is contained in:
parent
5eb3784527
commit
afe00d02cd
1 changed files with 16 additions and 14 deletions
|
|
@ -80,19 +80,21 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const exporter = new Exporter(boardId);
|
const exporter = new Exporter(boardId);
|
||||||
//if (exporter.canExport(user)) {
|
if (exporter.canExport(user)) {
|
||||||
body = params.query.delimiter
|
body = params.query.delimiter
|
||||||
? exporter.buildCsv(params.query.delimiter)
|
? exporter.buildCsv(params.query.delimiter)
|
||||||
: exporter.buildCsv();
|
: exporter.buildCsv();
|
||||||
//'Content-Length': body.length,
|
res.writeHead(200, {
|
||||||
res.writeHead(200, {
|
// Checking length does not work https://github.com/wekan/wekan/issues/3173
|
||||||
'Content-Type': params.query.delimiter ? 'text/csv' : 'text/tsv',
|
// so not using it here
|
||||||
});
|
//'Content-Length': body.length,
|
||||||
res.write(body);
|
'Content-Type': params.query.delimiter ? 'text/csv' : 'text/tsv',
|
||||||
res.end();
|
});
|
||||||
//} else {
|
res.write(body);
|
||||||
// res.writeHead(403);
|
res.end();
|
||||||
// res.end('Permission Error');
|
} else {
|
||||||
//}
|
res.writeHead(403);
|
||||||
|
res.end('Permission Error');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue