return_flitter.error(res,401,{reason:'You do not have permission to edit this project.'})
}
@ -209,7 +225,7 @@ class v1 {
if(!project)return_flitter.error(res,404,{reason:req.params.api+' not found with the specified ID.'})
if(!devbug.permission.project.owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this '+req.params.api+'.'})
if(!awaitdevbug.permission[req.params.api].owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this '+req.params.api+'.'})
if(!target_user)return_flitter.error(res,404,{reason:'User not found with the specified ID.'})
if(!devbug.permission.project.owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!awaitdevbug.permission[req.params.api].owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!target_user)return_flitter.error(res,404,{reason:'User not found with the specified ID.'})
if(!devbug.permission.project.owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!awaitdevbug.permission[req.params.api].owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!target_user)return_flitter.error(res,404,{reason:'User not found with the specified ID.'})
if(!devbug.permission.project.view(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!awaitdevbug.permission[req.params.api].view(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!target_user)return_flitter.error(res,404,{reason:'User not found with the specified ID.'})
if(!devbug.permission.project.view(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!awaitdevbug.permission[req.params.api].view(project,req.session.auth.user))return_flitter.error(res,401,{reason:"You do not have permission to edit this "+req.params.api+"."})
if(!target_user)return_flitter.error(res,404,{reason:'User not found with the specified ID.'})
if(!devbug.permission.project.owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this '+req.params.api+'.'})
if(!awaitdevbug.permission[req.params.api].owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this '+req.params.api+'.'})
if(!project)return_flitter.error(res,404,{reason:req.params.api+' not found with the specified ID.'})
if(!devbug.permission.project.owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this project.'})
if(!awaitdevbug.permission[req.params.api].owns(project,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this '+req.params.api+'.'})
if(!snippet)return_flitter.error(res,404,{reason:'The specified snippet does not exist.'})
if(!awaitdevbug.permission.snippet.view(snippet,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to view this snippet.'})
if(!snippet)return_flitter.error(res,404,{reason:'The specified snippet does not exist.'})
if(!awaitdevbug.permission.snippet.owns(snippet,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this snippet.'})
if(!snippet)return_flitter.error(res,404,{reason:'The specified snippet does not exist.'})
if(!awaitdevbug.permission.snippet.edit(snippet,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this snippet.'})
if(!snippet)return_flitter.error(res,404,{reason:'The specified snippet does not exist.'})
if(!awaitdevbug.permission.snippet.edit(snippet,req.session.auth.user))return_flitter.error(res,401,{reason:'You do not have permission to edit this snippet.'})
// check required fields: title, data, mode
letfail=false
if(!req.body.title)fail='Snippet title is required.'
elseif(!req.body.data)fail='Snippet data is required.'
elseif(!req.body.mode)fail='Snippet mode is required.'