(ctx context.Context, arg database.GetWorkspaceAgentPortShareParams)
| 4947 | } |
| 4948 | |
| 4949 | func (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 | |
| 4963 | func (q *querier) GetWorkspaceAgentScriptTimingsByBuildID(ctx context.Context, id uuid.UUID) ([]database.GetWorkspaceAgentScriptTimingsByBuildIDRow, error) { |
| 4964 | if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceSystem); err != nil { |
nothing calls this directly
no test coverage detected