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

Method CountConnectionLogs

coderd/database/dbauthz/dbauthz.go:1829–1840  ·  view source on GitHub ↗
(ctx context.Context, arg database.CountConnectionLogsParams)

Source from the content-addressed store, hash-verified

1827}
1828
1829func (q *querier) CountConnectionLogs(ctx context.Context, arg database.CountConnectionLogsParams) (int64, error) {
1830 // Just like the actual query, shortcut if the user is an owner.
1831 err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceConnectionLog)
1832 if err == nil {
1833 return q.db.CountConnectionLogs(ctx, arg)
1834 }
1835 prep, err := prepareSQLFilter(ctx, q.auth, policy.ActionRead, rbac.ResourceConnectionLog.Type)
1836 if err != nil {
1837 return 0, xerrors.Errorf("(dev error) prepare sql filter: %w", err)
1838 }
1839 return q.db.CountAuthorizedConnectionLogs(ctx, arg, prep)
1840}
1841
1842func (q *querier) CountEnabledModelsWithoutPricing(ctx context.Context) (int64, error) {
1843 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceDeploymentConfig); err != nil {

Callers 1

Calls 5

authorizeContextMethod · 0.95
prepareSQLFilterFunction · 0.85
CountConnectionLogsMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected