Skip to content

Commit

Permalink
chore: add logs when user is not allowed to execute the command
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadin Anuwattanaporn committed Oct 23, 2024
1 parent e11c0e8 commit 03b61b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/events/command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (c *DefaultCommandRunner) checkUserPermissions(repo models.Repo, user model
}
ok := c.TeamAllowlistChecker.IsCommandAllowedForAnyTeam(ctx, user.Teams, cmdName)
if !ok {
ctx.Log.Info("user %q teams %q does not have permissions to execute %q command", user.Username, user.Teams, cmdName)
return false, nil
}
return true, nil
Expand Down

0 comments on commit 03b61b1

Please sign in to comment.