From 03b61b17e0af210db9cf7463b8e16c3b5ef54042 Mon Sep 17 00:00:00 2001 From: Chadin Anuwattanaporn Date: Wed, 23 Oct 2024 21:08:35 +0800 Subject: [PATCH] chore: add logs when user is not allowed to execute the command --- server/events/command_runner.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/events/command_runner.go b/server/events/command_runner.go index 0b3c112d3d..46a5e75e13 100644 --- a/server/events/command_runner.go +++ b/server/events/command_runner.go @@ -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