Merge pull request #1250 from tangcent/fix#1249

fix: 修改Swagger自动同步信息时检查权限
This commit is contained in:
sean1025 2019-07-30 14:01:08 +08:00 committed by GitHub
commit b77438bdf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,11 @@ class syncController extends baseController {
if (!projectId) {
return (ctx.body = yapi.commons.resReturn(null, 408, '缺少项目Id'));
}
if ((await this.checkAuth(projectId, 'project', 'edit')) !== true) {
return (ctx.body = yapi.commons.resReturn(null, 405, '没有权限'));
}
let result;
if (requestBody.id) {
result = await this.syncModel.up(requestBody);