mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
fix: add extra check for code intelligence inference (#64083)
This commit is contained in:
parent
d249b8f701
commit
2333ddeaab
@ -10,6 +10,10 @@ import (
|
||||
)
|
||||
|
||||
func (r *rootResolver) CodeIntelligenceInferenceScript(ctx context.Context) (script string, err error) {
|
||||
if err := r.siteAdminChecker.CheckCurrentUserIsSiteAdmin(ctx); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
ctx, _, endObservation := r.operations.codeIntelligenceInferenceScript.With(ctx, &err, observation.Args{})
|
||||
defer endObservation(1, observation.Args{})
|
||||
|
||||
@ -17,6 +21,10 @@ func (r *rootResolver) CodeIntelligenceInferenceScript(ctx context.Context) (scr
|
||||
}
|
||||
|
||||
func (r *rootResolver) UpdateCodeIntelligenceInferenceScript(ctx context.Context, args *resolverstubs.UpdateCodeIntelligenceInferenceScriptArgs) (_ *resolverstubs.EmptyResponse, err error) {
|
||||
if err := r.siteAdminChecker.CheckCurrentUserIsSiteAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ctx, _, endObservation := r.operations.updateCodeIntelligenceInferenceScript.With(ctx, &err, observation.Args{Attrs: []attribute.KeyValue{
|
||||
attribute.String("script", args.Script),
|
||||
}})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user