zahmis 4 lat temu
rodzic
commit
8447fe5e67

+ 7 - 0
packages/slackbot-proxy/src/services/RelationsService.ts

@@ -128,6 +128,13 @@ export class RelationsService {
 
       [...singleUse, ...broadCastUse].forEach(async(tempCommandName) => {
 
+        // ex. search OR search:handlerName
+        const commandRegExp = new RegExp(`(^${tempCommandName}$)|(^${tempCommandName}:\\w+)`);
+        // skip this forEach loop if the requested command is not in permissionsForBroadcastUseCommands and permissionsForSingleUseCommands
+        if (!commandRegExp.test(actionId) && !commandRegExp.test(callbackId)) {
+          return;
+        }
+
         // case: singleUse
         permissionForInteractions = relation.permissionsForSingleUseCommands[tempCommandName];
         // case: broadcastUse