yusuketk 6 years ago
parent
commit
d2583da13c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/server/routes/apiv3/security-setting.js

+ 1 - 1
src/server/routes/apiv3/security-setting.js

@@ -15,7 +15,7 @@ const validator = {
     body('restrictGuestMode').isString().isIn([
     body('restrictGuestMode').isString().isIn([
       'Deny', 'Readonly',
       'Deny', 'Readonly',
     ]),
     ]),
-    body('pageCompleteDeletionAuthority').isString().isIn([
+    body('pageCompleteDeletionAuthority').if((value, { req }) => req.body.pageCompleteDeletionAuthority).isString().isIn([
       'anyOne', 'adminOnly', 'adminAndAuthor',
       'anyOne', 'adminOnly', 'adminAndAuthor',
     ]),
     ]),
     body('hideRestrictedByOwner').if((value, { req }) => req.body.hideRestrictedByOwner).isBoolean(),
     body('hideRestrictedByOwner').if((value, { req }) => req.body.hideRestrictedByOwner).isBoolean(),