Skip to content

Commit

Permalink
fix(distribution): ensure only suspended inquiries can be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
luytena authored and anehx committed Oct 24, 2022
1 parent 58fe428 commit 9b28ee7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/distribution/addon/abilities/inquiry.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ export default class InquiryAbility extends Ability {
}

get canSend() {
return this.config.permissions.sendInquiry?.(this.model) ?? true;
return (
!this.config.ui.readonly &&
this.model?.task.slug === this.config.inquiry.task &&
this.model?.status === "SUSPENDED" &&
(this.config.permissions.sendInquiry?.(this.model) ?? true) &&
this.model?.controllingGroups
.map(String)
.includes(String(this.calumaOptions.currentGroupId))
);
}

get canWithdraw() {
Expand Down

0 comments on commit 9b28ee7

Please sign in to comment.