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

Method GetWorkspaceAgentPortShare

coderd/database/dbauthz/dbauthz.go:4949–4961  ·  view source on GitHub ↗
(ctx context.Context, arg database.GetWorkspaceAgentPortShareParams)

Source from the content-addressed store, hash-verified

4947}
4948
4949func (q *querier) GetWorkspaceAgentPortShare(ctx context.Context, arg database.GetWorkspaceAgentPortShareParams) (database.WorkspaceAgentPortShare, error) {
4950 w, err := q.db.GetWorkspaceByID(ctx, arg.WorkspaceID)
4951 if err != nil {
4952 return database.WorkspaceAgentPortShare{}, err
4953 }
4954
4955 // reading a workspace port share is more akin to just reading the workspace.
4956 if err = q.authorizeContext(ctx, policy.ActionRead, w.RBACObject()); err != nil {
4957 return database.WorkspaceAgentPortShare{}, xerrors.Errorf("authorize context: %w", err)
4958 }
4959
4960 return q.db.GetWorkspaceAgentPortShare(ctx, arg)
4961}
4962
4963func (q *querier) GetWorkspaceAgentScriptTimingsByBuildID(ctx context.Context, id uuid.UUID) ([]database.GetWorkspaceAgentScriptTimingsByBuildIDRow, error) {
4964 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceSystem); err != nil {

Callers

nothing calls this directly

Calls 5

authorizeContextMethod · 0.95
GetWorkspaceByIDMethod · 0.65
RBACObjectMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected