Taichi Masuyama 4 лет назад
Родитель
Сommit
ce2fce6d10

+ 4 - 0
packages/app/src/server/crowi/index.js

@@ -22,6 +22,7 @@ import SearchService from '../service/search';
 import AttachmentService from '../service/attachment';
 import PageService from '../service/page';
 import PageGrantService from '../service/page-grant';
+import PageOperationService from '../service/page-operation';
 import { SlackIntegrationService } from '../service/slack-integration';
 import { UserNotificationService } from '../service/user-notification';
 import { InstallerService } from '../service/installer';
@@ -679,6 +680,9 @@ Crowi.prototype.setupPageService = async function() {
   if (this.pageGrantService == null) {
     this.pageGrantService = new PageGrantService(this);
   }
+  if (this.pageOperationService == null) {
+    this.pageOperationService = new PageOperationService(this);
+  }
 };
 
 Crowi.prototype.setupInAppNotificationService = async function() {

+ 20 - 0
packages/app/src/server/service/page-operation.ts

@@ -0,0 +1,20 @@
+class PageOperationService {
+
+  crowi: any;
+
+  constructor(crowi) {
+    this.crowi = crowi;
+  }
+
+  /**
+   * Check if the operation is processable by comparing the "path" with all PageOperation documents
+   * @param path path to operate
+   * @returns Promise<boolean>
+   */
+  async shouldBlock(path: string): Promise<boolean> {
+    return true;
+  }
+
+}
+
+export default PageOperationService;