|
@@ -268,14 +268,6 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
const payload:any = JSON.parse(body.payload);
|
|
const payload:any = JSON.parse(body.payload);
|
|
|
const callbackId:string = payload?.view?.callback_id;
|
|
const callbackId:string = payload?.view?.callback_id;
|
|
|
- const actionId:string = payload?.actions?.[0].action_id;
|
|
|
|
|
- let privateMeta:any;
|
|
|
|
|
-
|
|
|
|
|
- if (payload.view != null) {
|
|
|
|
|
- privateMeta = JSON.parse(payload?.view?.private_metadata);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const channelName = payload.channel?.name || privateMeta?.body?.channel_name || privateMeta?.channelName;
|
|
|
|
|
const installationId = authorizeResult.enterpriseId || authorizeResult.teamId;
|
|
const installationId = authorizeResult.enterpriseId || authorizeResult.teamId;
|
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
|
const installation = await this.installationRepository.findByTeamIdOrEnterpriseId(installationId!);
|
|
const installation = await this.installationRepository.findByTeamIdOrEnterpriseId(installationId!);
|
|
@@ -303,6 +295,14 @@ export class SlackCtrl {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ let privateMeta:any;
|
|
|
|
|
+
|
|
|
|
|
+ if (payload.view != null) {
|
|
|
|
|
+ privateMeta = JSON.parse(payload?.view?.private_metadata);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const channelName = payload.channel?.name || privateMeta?.body?.channel_name || privateMeta?.channelName;
|
|
|
|
|
+
|
|
|
// forward to GROWI server
|
|
// forward to GROWI server
|
|
|
if (callbackId === 'select_growi') {
|
|
if (callbackId === 'select_growi') {
|
|
|
// Send response immediately to avoid opelation_timeout error
|
|
// Send response immediately to avoid opelation_timeout error
|
|
@@ -331,6 +331,7 @@ export class SlackCtrl {
|
|
|
const allowedRelations:RelationMock[] = [];
|
|
const allowedRelations:RelationMock[] = [];
|
|
|
const disallowedGrowiUrls: Set<string> = new Set();
|
|
const disallowedGrowiUrls: Set<string> = new Set();
|
|
|
let notAllowedCommandName!:string;
|
|
let notAllowedCommandName!:string;
|
|
|
|
|
+ const actionId:string = payload?.actions?.[0].action_id;
|
|
|
|
|
|
|
|
await Promise.all(relations.map(async(relation) => {
|
|
await Promise.all(relations.map(async(relation) => {
|
|
|
const permission = await this.relationsService.checkPermissionForInteractions(relation, channelName, callbackId, actionId);
|
|
const permission = await this.relationsService.checkPermissionForInteractions(relation, channelName, callbackId, actionId);
|