diff --git a/shortcuts/minutes/minutes_detail.go b/shortcuts/minutes/minutes_detail.go index 8a7f4f1aa..ca55cb54a 100644 --- a/shortcuts/minutes/minutes_detail.go +++ b/shortcuts/minutes/minutes_detail.go @@ -53,7 +53,7 @@ func fetchMinuteDetail(ctx context.Context, runtime *common.RuntimeContext, minu if err != nil { result := &minuteDetailItem{MinuteToken: minuteToken} if p, ok := errs.ProblemOf(err); ok && p.Code == minutesDetailNoReadPermissionCode { - result.Error = fmt.Sprintf("No read permission for minute %s. Ask the minute owner for minute file read permission", minuteToken) + result.Error = fmt.Sprintf("No read permission for minute %s. Ask the user before running: minutes +apply-permission --minute-token %s --perm view", minuteToken, minuteToken) } else { result.Error = fmt.Sprintf("failed to query minute: %v", err) } diff --git a/shortcuts/minutes/minutes_speaker_replace.go b/shortcuts/minutes/minutes_speaker_replace.go index 716230d3e..42e3d2878 100644 --- a/shortcuts/minutes/minutes_speaker_replace.go +++ b/shortcuts/minutes/minutes_speaker_replace.go @@ -148,7 +148,7 @@ func minutesSpeakerReplaceError(err error, minuteToken, sourceSpeaker string) er switch p.Code { case minutesSpeakerReplaceNoEditPermission: p.Message = fmt.Sprintf("No edit permission for minute %q: cannot replace the transcript speaker.", minuteToken) - p.Hint = "Ask the minute owner for minute edit permission" + p.Hint = fmt.Sprintf("Ask the user before running: minutes +apply-permission --minute-token %s --perm edit", minuteToken) case minutesSpeakerReplaceSpeakerNotFoundCode: p.Subtype = errs.SubtypeNotFound p.Message = fmt.Sprintf("Speaker not found in minute %q: source speaker %q does not match an existing speaker in the transcript.", minuteToken, sourceSpeaker) diff --git a/shortcuts/minutes/minutes_speaker_replace_test.go b/shortcuts/minutes/minutes_speaker_replace_test.go index 5b028a249..c00057bbc 100644 --- a/shortcuts/minutes/minutes_speaker_replace_test.go +++ b/shortcuts/minutes/minutes_speaker_replace_test.go @@ -404,7 +404,7 @@ func TestMinutesSpeakerReplace_NoEditPermission(t *testing.T) { if !strings.Contains(p.Message, minutesSpeakerReplaceTestToken) { t.Errorf("message should include minute token, got: %s", p.Message) } - if !strings.Contains(p.Hint, "edit permission") { - t.Errorf("hint should mention edit permission, got: %s", p.Hint) + if !strings.Contains(p.Hint, "+apply-permission") { + t.Errorf("hint should mention apply-permission, got: %s", p.Hint) } } diff --git a/shortcuts/minutes/minutes_summary_todo_test.go b/shortcuts/minutes/minutes_summary_todo_test.go index 0ebd3d297..ca41db977 100644 --- a/shortcuts/minutes/minutes_summary_todo_test.go +++ b/shortcuts/minutes/minutes_summary_todo_test.go @@ -400,8 +400,8 @@ func TestMinutesTodo_NoEditPermission(t *testing.T) { if !strings.Contains(p.Message, minutesSummaryTodoTestToken) { t.Errorf("message should include minute token, got: %s", p.Message) } - if !strings.Contains(p.Hint, "edit permission") { - t.Errorf("hint should mention edit permission, got: %s", p.Hint) + if !strings.Contains(p.Hint, "+apply-permission") { + t.Errorf("hint should mention apply-permission, got: %s", p.Hint) } } diff --git a/shortcuts/minutes/minutes_todo.go b/shortcuts/minutes/minutes_todo.go index 70730b439..93c84ea07 100644 --- a/shortcuts/minutes/minutes_todo.go +++ b/shortcuts/minutes/minutes_todo.go @@ -288,6 +288,6 @@ func minutesTodoError(err error, minuteToken string) error { } p.Subtype = errs.SubtypePermissionDenied p.Message = fmt.Sprintf("No edit permission for minute %q: cannot update todos.", minuteToken) - p.Hint = "Ask the minute owner for minute edit permission" + p.Hint = fmt.Sprintf("Ask the user before running: minutes +apply-permission --minute-token %s --perm edit", minuteToken) return err } diff --git a/shortcuts/minutes/minutes_update.go b/shortcuts/minutes/minutes_update.go index b7fa2bf66..6b9f93783 100644 --- a/shortcuts/minutes/minutes_update.go +++ b/shortcuts/minutes/minutes_update.go @@ -79,6 +79,6 @@ func minutesUpdateError(err error, minuteToken string) error { return err } p.Message = fmt.Sprintf("No edit permission for minute %q: cannot update the title.", minuteToken) - p.Hint = "Ask the minute owner for minute edit permission" + p.Hint = fmt.Sprintf("Ask the user before running: minutes +apply-permission --minute-token %s --perm edit", minuteToken) return err } diff --git a/shortcuts/minutes/minutes_update_test.go b/shortcuts/minutes/minutes_update_test.go index 222649367..7356aaedf 100644 --- a/shortcuts/minutes/minutes_update_test.go +++ b/shortcuts/minutes/minutes_update_test.go @@ -171,7 +171,7 @@ func TestMinutesUpdate_NoEditPermission(t *testing.T) { if !strings.Contains(p.Message, minutesUpdateTestToken) { t.Errorf("message should include minute token, got: %s", p.Message) } - if !strings.Contains(p.Hint, "edit permission") { - t.Errorf("hint should mention edit permission, got: %s", p.Hint) + if !strings.Contains(p.Hint, "+apply-permission") { + t.Errorf("hint should mention apply-permission, got: %s", p.Hint) } } diff --git a/shortcuts/minutes/minutes_word_replace.go b/shortcuts/minutes/minutes_word_replace.go index 2cae38eb9..db7f2a9b4 100644 --- a/shortcuts/minutes/minutes_word_replace.go +++ b/shortcuts/minutes/minutes_word_replace.go @@ -139,7 +139,7 @@ func minutesWordReplaceError(err error, minuteToken string) error { case minutesWordReplaceNoEditPermission: p.Subtype = errs.SubtypePermissionDenied p.Message = fmt.Sprintf("No edit permission for minute %q: cannot replace transcript words.", minuteToken) - p.Hint = "Ask the minute owner for minute edit permission" + p.Hint = fmt.Sprintf("Ask the user before running: minutes +apply-permission --minute-token %s --perm edit", minuteToken) case minutesWordReplaceOthersEditing: p.Subtype = errs.SubtypeConflict p.Message = fmt.Sprintf("Minute %q transcript is being edited by someone else.", minuteToken) diff --git a/shortcuts/vc/vc_notes.go b/shortcuts/vc/vc_notes.go index 555acc70a..0d1b03259 100644 --- a/shortcuts/vc/vc_notes.go +++ b/shortcuts/vc/vc_notes.go @@ -68,7 +68,7 @@ func minutesReadError(err error, minuteToken string) error { return err } p.Message = fmt.Sprintf("No read permission for minute %s: cannot query the minute.", minuteToken) - p.Hint = "Ask the minute owner for minute file read permission" + p.Hint = fmt.Sprintf("Ask the user before running: minutes +apply-permission --minute-token %s --perm view", minuteToken) return err } diff --git a/shortcuts/vc/vc_notes_test.go b/shortcuts/vc/vc_notes_test.go index 992c5f2d9..d87ae13ad 100644 --- a/shortcuts/vc/vc_notes_test.go +++ b/shortcuts/vc/vc_notes_test.go @@ -1255,7 +1255,7 @@ func TestMinutesReadError_ProblemOf_EnrichesMessage(t *testing.T) { t.Errorf("error message not enriched: %q", errMsg) } hint, _ := note["hint"].(string) - if !strings.Contains(hint, "minute file read permission") { + if !strings.Contains(hint, "+apply-permission") { t.Errorf("hint not surfaced: %q", hint) } }