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

Method GetUsersByIDs

coderd/database/dbauthz/dbauthz.go:4844–4851  ·  view source on GitHub ↗

GetUsersByIDs is only used for usernames on workspace return data. This function should be replaced by joining this data to the workspace query itself.

(ctx context.Context, ids []uuid.UUID)

Source from the content-addressed store, hash-verified

4842// This function should be replaced by joining this data to the workspace query
4843// itself.
4844func (q *querier) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) ([]database.User, error) {
4845 for _, uid := range ids {
4846 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceUserObject(uid)); err != nil {
4847 return nil, err
4848 }
4849 }
4850 return q.db.GetUsersByIDs(ctx, ids)
4851}
4852
4853func (q *querier) GetWebpushSubscriptionsByUserID(ctx context.Context, userID uuid.UUID) ([]database.WebpushSubscription, error) {
4854 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceWebpushSubscription.WithOwner(userID.String())); err != nil {

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
ResourceUserObjectFunction · 0.92
GetUsersByIDsMethod · 0.65

Tested by

no test coverage detected