mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Better sanitization and validation for project-linked-file
This commit is contained in:
parent
1cbc901492
commit
b5e8ed81b9
1 changed files with 9 additions and 4 deletions
|
@ -43,13 +43,18 @@ SourceFileNotFoundError.prototype.__proto__ = Error.prototype
|
|||
module.exports = ProjectFileAgent =
|
||||
|
||||
sanitizeData: (data) ->
|
||||
return data
|
||||
return _.pick(
|
||||
data,
|
||||
'source_project_id',
|
||||
'source_entity_path',
|
||||
'source_project_display_name'
|
||||
)
|
||||
|
||||
_validate: (data) ->
|
||||
return (
|
||||
!!data.source_project_id &&
|
||||
!!data.source_entity_path &&
|
||||
!!data.source_project_display_name
|
||||
data.source_project_id? &&
|
||||
data.source_entity_path? &&
|
||||
data.source_project_display_name?
|
||||
)
|
||||
|
||||
checkAuth: (project_id, data, current_user_id, callback = (error, allowed)->) ->
|
||||
|
|
Loading…
Reference in a new issue