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

Method GetOAuth2ProviderAppsByUserID

coderd/database/dbauthz/dbauthz.go:3811–3818  ·  view source on GitHub ↗
(ctx context.Context, userID uuid.UUID)

Source from the content-addressed store, hash-verified

3809}
3810
3811func (q *querier) GetOAuth2ProviderAppsByUserID(ctx context.Context, userID uuid.UUID) ([]database.GetOAuth2ProviderAppsByUserIDRow, error) {
3812 // This authz check is to make sure the caller can read all their own tokens.
3813 if err := q.authorizeContext(ctx, policy.ActionRead,
3814 rbac.ResourceOauth2AppCodeToken.WithOwner(userID.String())); err != nil {
3815 return []database.GetOAuth2ProviderAppsByUserIDRow{}, err
3816 }
3817 return q.db.GetOAuth2ProviderAppsByUserID(ctx, userID)
3818}
3819
3820func (q *querier) GetOrganizationByID(ctx context.Context, id uuid.UUID) (database.Organization, error) {
3821 return fetch(q.log, q.auth, q.db.GetOrganizationByID)(ctx, id)

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
WithOwnerMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected