mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: update autostart context to include querying users (#10929)
This commit is contained in:
@ -227,6 +227,12 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
|
||||
options.Database, options.Pubsub = dbtestutil.NewDB(t)
|
||||
}
|
||||
|
||||
accessControlStore := &atomic.Pointer[dbauthz.AccessControlStore]{}
|
||||
var acs dbauthz.AccessControlStore = dbauthz.AGPLTemplateAccessControlStore{}
|
||||
accessControlStore.Store(&acs)
|
||||
|
||||
options.Database = dbauthz.New(options.Database, options.Authorizer, *options.Logger, accessControlStore)
|
||||
|
||||
// Some routes expect a deployment ID, so just make sure one exists.
|
||||
// Check first incase the caller already set up this database.
|
||||
// nolint:gocritic // Setting up unit test data inside test helper
|
||||
@ -266,10 +272,6 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
|
||||
t.Cleanup(closeBatcher)
|
||||
}
|
||||
|
||||
accessControlStore := &atomic.Pointer[dbauthz.AccessControlStore]{}
|
||||
var acs dbauthz.AccessControlStore = dbauthz.AGPLTemplateAccessControlStore{}
|
||||
accessControlStore.Store(&acs)
|
||||
|
||||
var templateScheduleStore atomic.Pointer[schedule.TemplateScheduleStore]
|
||||
if options.TemplateScheduleStore == nil {
|
||||
options.TemplateScheduleStore = schedule.NewAGPLTemplateScheduleStore()
|
||||
|
Reference in New Issue
Block a user