mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 01:23:59 +00:00
explicitly set the file types to delete
the wild card version can get mixed up with app.del '/project/:project_id/contents/*', httpAuth, TpdsController.deleteProjectContents
This commit is contained in:
parent
0a123418ac
commit
011bdc4617
2 changed files with 16 additions and 1 deletions
|
@ -57,6 +57,18 @@ module.exports = EditorHttpController =
|
|||
return next(error) if error?
|
||||
res.send 204
|
||||
|
||||
deleteDoc: (req, res, next)->
|
||||
req.params.entity_type = "doc"
|
||||
EditorHttpController.deleteEntity(req, res, next)
|
||||
|
||||
deleteFile: (req, res, next)->
|
||||
req.params.entity_type = "file"
|
||||
EditorHttpController.deleteEntity(req, res, next)
|
||||
|
||||
deleteFolder: (req, res, next)->
|
||||
req.params.entity_type = "folder"
|
||||
EditorHttpController.deleteEntity(req, res, next)
|
||||
|
||||
deleteEntity: (req, res, next) ->
|
||||
project_id = req.params.Project_id
|
||||
entity_id = req.params.entity_id
|
||||
|
|
|
@ -103,7 +103,10 @@ module.exports = class Router
|
|||
|
||||
app.post '/project/:Project_id/:entity_type/:entity_id/rename', SecurityManager.requestCanModifyProject, EditorHttpController.renameEntity
|
||||
app.post '/project/:Project_id/:entity_type/:entity_id/move', SecurityManager.requestCanModifyProject, EditorHttpController.moveEntity
|
||||
app.delete '/project/:Project_id/:entity_type/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteEntity
|
||||
|
||||
app.delete '/project/:Project_id/file/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteFile
|
||||
app.delete '/project/:Project_id/doc/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteDoc
|
||||
app.delete '/project/:Project_id/folder/:entity_id', SecurityManager.requestCanModifyProject, EditorHttpController.deleteFolder
|
||||
|
||||
app.post '/project/:Project_id/compile', SecurityManager.requestCanAccessProject, CompileController.compile
|
||||
app.get '/Project/:Project_id/output/output.pdf', SecurityManager.requestCanAccessProject, CompileController.downloadPdf
|
||||
|
|
Loading…
Reference in a new issue