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

Method GetWorkspaceAgentsByParentID

coderd/database/dbauthz/dbauthz.go:5020–5031  ·  view source on GitHub ↗
(ctx context.Context, parentID uuid.UUID)

Source from the content-addressed store, hash-verified

5018}
5019
5020func (q *querier) GetWorkspaceAgentsByParentID(ctx context.Context, parentID uuid.UUID) ([]database.WorkspaceAgent, error) {
5021 workspace, err := q.db.GetWorkspaceByAgentID(ctx, parentID)
5022 if err != nil {
5023 return nil, err
5024 }
5025
5026 if err := q.authorizeContext(ctx, policy.ActionRead, workspace); err != nil {
5027 return nil, err
5028 }
5029
5030 return q.db.GetWorkspaceAgentsByParentID(ctx, parentID)
5031}
5032
5033// GetWorkspaceAgentsByResourceIDs
5034// The workspace/job is already fetched.

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetWorkspaceByAgentIDMethod · 0.65

Tested by

no test coverage detected