mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
14 lines
341 B
Go
14 lines
341 B
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/contexts/viewer"
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
// UserContext returns a new context with the provided user as the viewer.
|
|
func UserContext(user *fleet.User) context.Context {
|
|
return viewer.NewContext(context.Background(), viewer.Viewer{User: user})
|
|
}
|