Skip to content

Commit

Permalink
Fixing behavour of /playbook add slash command. (#1898)
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller authored Mar 27, 2024
1 parent 2e9752a commit 66f254e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 66f254e

Please sign in to comment.