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

Method ListWorkspaceAgentPortShares

coderd/database/dbauthz/dbauthz.go:6267–6279  ·  view source on GitHub ↗
(ctx context.Context, workspaceID uuid.UUID)

Source from the content-addressed store, hash-verified

6265}
6266
6267func (q *querier) ListWorkspaceAgentPortShares(ctx context.Context, workspaceID uuid.UUID) ([]database.WorkspaceAgentPortShare, error) {
6268 workspace, err := q.db.GetWorkspaceByID(ctx, workspaceID)
6269 if err != nil {
6270 return nil, err
6271 }
6272
6273 // listing port shares is more akin to reading the workspace.
6274 if err := q.authorizeContext(ctx, policy.ActionRead, workspace); err != nil {
6275 return nil, err
6276 }
6277
6278 return q.db.ListWorkspaceAgentPortShares(ctx, workspaceID)
6279}
6280
6281func (q *querier) MarkAllInboxNotificationsAsRead(ctx context.Context, arg database.MarkAllInboxNotificationsAsReadParams) error {
6282 resource := rbac.ResourceInboxNotification.WithOwner(arg.UserID.String())

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetWorkspaceByIDMethod · 0.65

Tested by

no test coverage detected