From 66f254e2b8de292b320f0c4fc3efb1e725c46007 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 27 Mar 2024 14:55:54 -0700 Subject: [PATCH] Fixing behavour of /playbook add slash command. (#1898) --- server/command/command.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/command/command.go b/server/command/command.go index f59073ab15..e136cdbdd5 100644 --- a/server/command/command.go +++ b/server/command/command.go @@ -815,6 +815,17 @@ func (r *Runner) actionAdd(args []string) { return } + post, err := r.pluginAPI.Post.GetPost(postID) + if err != nil { + r.warnUserAndLogErrorf("Error: %v", err) + return + } + + if !r.pluginAPI.User.HasPermissionToChannel(r.args.UserId, post.ChannelId, model.PermissionReadChannel) { + r.warnUserAndLogErrorf("Error no permission to post specified") + return + } + requesterInfo, err := app.GetRequesterInfo(r.args.UserId, r.pluginAPI) if err != nil { r.warnUserAndLogErrorf("Error: %v", err)