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

Function prepareSQLFilter

coderd/database/dbauthz/dbauthz.go:1140–1147  ·  view source on GitHub ↗

prepareSQLFilter is a helper function that prepares a SQL filter using the given authorization context.

(ctx context.Context, authorizer rbac.Authorizer, action policy.Action, resourceType string)

Source from the content-addressed store, hash-verified

1138// prepareSQLFilter is a helper function that prepares a SQL filter using the
1139// given authorization context.
1140func prepareSQLFilter(ctx context.Context, authorizer rbac.Authorizer, action policy.Action, resourceType string) (rbac.PreparedAuthorized, error) {
1141 act, ok := ActorFromContext(ctx)
1142 if !ok {
1143 return nil, ErrNoActor
1144 }
1145
1146 return authorizer.Prepare(ctx, act, action, resourceType)
1147}
1148
1149func (q *querier) Ping(ctx context.Context) (time.Duration, error) {
1150 return q.db.Ping(ctx)

Callers 15

CountAIBridgeSessionsMethod · 0.85
CountAuditLogsMethod · 0.85
CountConnectionLogsMethod · 0.85
GetAuditLogsOffsetMethod · 0.85
GetChatFileByIDMethod · 0.85
GetChatFilesByIDsMethod · 0.85
GetChatsMethod · 0.85
GetUsersMethod · 0.85
GetWorkspacesMethod · 0.85

Calls 2

ActorFromContextFunction · 0.70
PrepareMethod · 0.65

Tested by

no test coverage detected