Просмотр исходного кода

disable page duplicate when page grant is multiple groups

Futa Arai 2 лет назад
Родитель
Сommit
b7850191ee
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      apps/app/src/server/routes/apiv3/pages.js

+ 5 - 0
apps/app/src/server/routes/apiv3/pages.js

@@ -794,6 +794,11 @@ module.exports = (crowi) => {
 
       const page = await Page.findByIdAndViewer(pageId, req.user, null, true);
 
+      // TODO: remove in https://redmine.weseek.co.jp/issues/136139
+      if (page.grantedGroups != null && page.grantedGroups.length > 1) {
+        return res.apiv3Err('Cannot grant multiple groups to page at the moment');
+      }
+
       const isEmptyAndNotRecursively = page?.isEmpty && !isRecursively;
       if (page == null || isEmptyAndNotRecursively) {
         res.code = 'Page is not found';