summaryrefslogtreecommitdiffstats
path: root/api4/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/command.go')
-rw-r--r--api4/command.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/api4/command.go b/api4/command.go
index d051d57f6..4314a184d 100644
--- a/api4/command.go
+++ b/api4/command.go
@@ -212,12 +212,9 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if commandArgs.TeamId == "" {
- commandArgs.TeamId = channel.TeamId
- } else if c.Session.GetTeamByTeamId(commandArgs.TeamId) == nil {
- c.SetPermissionError(model.PERMISSION_USE_SLASH_COMMANDS)
- return
- }
+ // team id is implicitly taken from channel so that slash commands
+ // created on some other team can't be run against this one
+ commandArgs.TeamId = channel.TeamId
commandArgs.UserId = c.Session.UserId
commandArgs.T = c.T