2022-10-19 14:19:43 -05:00
|
|
|
package eval
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-11-14 08:47:34 -06:00
|
|
|
"github.com/grafana/grafana/pkg/services/auth/identity"
|
2022-10-19 14:19:43 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// EvaluationContext represents the context in which a condition is evaluated.
|
|
|
|
type EvaluationContext struct {
|
2022-11-02 09:13:39 -05:00
|
|
|
Ctx context.Context
|
2023-11-14 08:47:34 -06:00
|
|
|
User identity.Requester
|
2022-10-19 14:19:43 -05:00
|
|
|
}
|
|
|
|
|
2023-11-14 08:47:34 -06:00
|
|
|
func NewContext(ctx context.Context, user identity.Requester) EvaluationContext {
|
2022-10-19 14:19:43 -05:00
|
|
|
return EvaluationContext{
|
|
|
|
Ctx: ctx,
|
|
|
|
User: user,
|
|
|
|
}
|
|
|
|
}
|