zahmis 4 лет назад
Родитель
Сommit
3bf0032e72

+ 1 - 1
packages/slackbot-proxy/src/controllers/slack.ts

@@ -330,7 +330,7 @@ export class SlackCtrl {
 
 
     await Promise.all(relations.map(async(relation) => {
-      await this.relationsService.checkPermissionForInteractions(relation, channelName, callbackId, actionId, body, relations);
+      await this.relationsService.checkPermissionForInteractions(relation, channelName, callbackId, actionId);
 
       /*
        * forward to GROWI server

+ 19 - 19
packages/slackbot-proxy/src/services/RelationsService.ts

@@ -107,26 +107,26 @@ export class RelationsService {
     return permission;
   }
 
-  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
-  postNotAllowedMessage(relations:RelationMock[], commandName:string, body:any):Promise<ChatPostEphemeralResponse> {
-    const botToken = relations[0].installation?.data.bot?.token;
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-    const client = generateWebClient(botToken!);
-
-    return client.chat.postEphemeral({
-      text: 'Error occured.',
-      channel: body.channel_id,
-      user: body.user_id,
-      blocks: [
-        markdownSectionBlock(`It is not allowed to run *'${commandName}'* command to this GROWI.`),
-      ],
-    });
-  }
+  // // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+  // postNotAllowedMessage(relations:RelationMock[], commandName:string, body:any):Promise<ChatPostEphemeralResponse> {
+  //   const botToken = relations[0].installation?.data.bot?.token;
+  //   // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+  //   const client = generateWebClient(botToken!);
+
+  //   return client.chat.postEphemeral({
+  //     text: 'Error occured.',
+  //     channel: body.channel_id,
+  //     user: body.user_id,
+  //     blocks: [
+  //       markdownSectionBlock(`It is not allowed to run *'${commandName}'* command to this GROWI.`),
+  //     ],
+  //   });
+  // }
 
 
   async checkPermissionForInteractions(
       // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
-      relation:RelationMock, channelName:string, callbackId:string, actionId:string, body:any, relations:RelationMock[],
+      relation:RelationMock, channelName:string, callbackId:string, actionId:string,
   ):Promise<void> {
 
     const baseDate = new Date();
@@ -171,9 +171,9 @@ export class RelationsService {
         return;
       }
 
-      if (!isPermittedForInteractions) {
-        this.postNotAllowedMessage(relations, commandName, body);
-      }
+      // if (!isPermittedForInteractions) {
+      //   this.postNotAllowedMessage(relations, commandName, body);
+      // }
     });
   }