fix(relay): say "channel owner or admin" in the call_webhook save refusal (#9169)

## Summary

The SEC-006 save gate in `handle_workflow_def` refuses a `call_webhook`
workflow unless the saver is an owner or admin. It looks up the role
with `get_member_role(community, channel_id, …)`, so this is the saver's
**channel** role. The refusal text said only "require the owner or admin
role", which reads as the community owner or admin.

Clients now show the relay's refusal text when a save is refused
(block/buzz-app is about to pass it through as written), so a member
would be sent after the wrong role. The refusal now says:

> forbidden: workflows with call_webhook actions require the **channel**
owner or admin role

- The role check is unchanged.
- The `forbidden:` prefix is unchanged, so clients still treat it as a
permission refusal.
- This now matches the desktop helper copy under the Webhook URL field
("Webhook steps require a channel owner or admin").

No test, fixture, doc or client copy in this repo quoted the old text,
so this is a one-line change.

### Related issue

None found for the save-path wording. #5135 (open) rewrites the SEC-006
refusals on the **trigger** path (`handle_workflow_trigger`) but leaves
this save-path string alone, so the two don't overlap.

### Testing

Not verified locally: no tests, builds, clippy or rustfmt were run, and
the commit was pushed with `--no-verify`. CI is the first check. The
change only edits a string literal.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: mtoohey <mtoohey@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Matt Toohey
2026-11-09 10:09:20 +11:00
committed by GitHub
parent 8cce12f591
commit 4bfe60197e

View File

@@ -697,7 +697,7 @@ async fn handle_workflow_def(
.map_err(|e| IngestError::Internal(format!("error: role check: {e}")))?;
if !matches!(role.as_deref(), Some("owner") | Some("admin")) {
return Err(IngestError::Rejected(
"forbidden: workflows with call_webhook actions require the owner or admin role"
"forbidden: workflows with call_webhook actions require the channel owner or admin role"
.into(),
));
}