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

Function insert

coderd/database/dbauthz/dbauthz.go:908–919  ·  view source on GitHub ↗

Generic functions used to implement the database.Store methods. insert runs an policy.ActionCreate on the rbac object argument before running the insertFunc. The insertFunc is expected to return the object that was inserted.

(
	logger slog.Logger,
	authorizer rbac.Authorizer,
	object rbac.Objecter,
	insertFunc Insert,
)

Source from the content-addressed store, hash-verified

906// running the insertFunc. The insertFunc is expected to return the object that
907// was inserted.
908func insert[
909 ObjectType any,
910 ArgumentType any,
911 Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
912](
913 logger slog.Logger,
914 authorizer rbac.Authorizer,
915 object rbac.Objecter,
916 insertFunc Insert,
917) Insert {
918 return insertWithAction(logger, authorizer, object, policy.ActionCreate, insertFunc)
919}
920
921func insertWithAction[
922 ObjectType any,

Callers 15

InsertAPIKeyMethod · 0.85
InsertAllUsersGroupMethod · 0.85
InsertAuditLogMethod · 0.85
InsertBoundaryLogMethod · 0.85
InsertBoundarySessionMethod · 0.85
InsertChatMethod · 0.85
InsertChatFileMethod · 0.85
InsertFileMethod · 0.85
InsertGroupMethod · 0.85
InsertOrganizationMethod · 0.85

Calls 1

insertWithActionFunction · 0.85

Tested by 1