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

Method UpdateWorkspaceAgentDirectoryByID

coderd/database/dbauthz/dbauthz.go:7721–7732  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpdateWorkspaceAgentDirectoryByIDParams)

Source from the content-addressed store, hash-verified

7719}
7720
7721func (q *querier) UpdateWorkspaceAgentDirectoryByID(ctx context.Context, arg database.UpdateWorkspaceAgentDirectoryByIDParams) error {
7722 workspace, err := q.db.GetWorkspaceByAgentID(ctx, arg.ID)
7723 if err != nil {
7724 return err
7725 }
7726
7727 if err := q.authorizeContext(ctx, policy.ActionUpdateAgent, workspace); err != nil {
7728 return err
7729 }
7730
7731 return q.db.UpdateWorkspaceAgentDirectoryByID(ctx, arg)
7732}
7733
7734func (q *querier) UpdateWorkspaceAgentDisplayAppsByID(ctx context.Context, arg database.UpdateWorkspaceAgentDisplayAppsByIDParams) error {
7735 workspace, err := q.db.GetWorkspaceByAgentID(ctx, arg.ID)

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetWorkspaceByAgentIDMethod · 0.65

Tested by

no test coverage detected