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

Method InsertWebpushSubscription

coderd/database/dbauthz/dbauthz.go:5900–5905  ·  view source on GitHub ↗
(ctx context.Context, arg database.InsertWebpushSubscriptionParams)

Source from the content-addressed store, hash-verified

5898}
5899
5900func (q *querier) InsertWebpushSubscription(ctx context.Context, arg database.InsertWebpushSubscriptionParams) (database.WebpushSubscription, error) {
5901 if err := q.authorizeContext(ctx, policy.ActionCreate, rbac.ResourceWebpushSubscription.WithOwner(arg.UserID.String())); err != nil {
5902 return database.WebpushSubscription{}, err
5903 }
5904 return q.db.InsertWebpushSubscription(ctx, arg)
5905}
5906
5907func (q *querier) InsertWorkspace(ctx context.Context, arg database.InsertWorkspaceParams) (database.WorkspaceTable, error) {
5908 obj := rbac.ResourceWorkspace.WithOwner(arg.OwnerID.String()).InOrg(arg.OrganizationID)

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
WithOwnerMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected