MCPcopy Index your code
hub / github.com/coder/coder / update

Function update

coderd/database/dbauthz/dbauthz.go:979–991  ·  view source on GitHub ↗
(
	logger slog.Logger,
	authorizer rbac.Authorizer,
	fetchFunc Fetch,
	updateExec Exec,
)

Source from the content-addressed store, hash-verified

977}
978
979func update[
980 ObjectType rbac.Objecter,
981 ArgumentType any,
982 Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
983 Exec func(ctx context.Context, arg ArgumentType) error,
984](
985 logger slog.Logger,
986 authorizer rbac.Authorizer,
987 fetchFunc Fetch,
988 updateExec Exec,
989) Exec {
990 return fetchAndExec(logger, authorizer, policy.ActionUpdate, fetchFunc, updateExec)
991}
992
993// fetch is a generic function that wraps a database
994// query function (returns an object and an error) with authorization. The

Calls 1

fetchAndExecFunction · 0.85

Tested by 1

coverUpdateFunction · 0.40