Alerting: Fix alerting evaluation to use proper permissions (#55127)
* access control to log user name if it does not have permissions * update ngalert Evaluator to accept user instead of creating a pseudo one * update alerting eval (rule\query testing) API to provide the real user to the Evaluator * update scheduler to create a pseudo user with proper permissions
This commit is contained in:
@@ -34,7 +34,7 @@ func (a *AccessControl) Evaluate(ctx context.Context, user *user.SignedInUser, e
|
||||
metrics.MAccessEvaluationCount.Inc()
|
||||
|
||||
if !verifyPermissions(user) {
|
||||
a.log.Warn("no permissions set for user", "userID", user.UserID, "orgID", user.OrgID)
|
||||
a.log.Warn("no permissions set for user", "userID", user.UserID, "orgID", user.OrgID, "login", user.Login)
|
||||
return false, nil
|
||||
}
|
||||
// Test evaluation without scope resolver first, this will prevent 403 for wildcard scopes when resource does not exist
|
||||
|
||||
Reference in New Issue
Block a user