(ctx context.Context, arg database.CountAuditLogsParams)
| 1813 | } |
| 1814 | |
| 1815 | func (q *querier) CountAuditLogs(ctx context.Context, arg database.CountAuditLogsParams) (int64, error) { |
| 1816 | // Shortcut if the user is an owner. The SQL filter is noticeable, |
| 1817 | // and this is an easy win for owners. Which is the common case. |
| 1818 | err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceAuditLog) |
| 1819 | if err == nil { |
| 1820 | return q.db.CountAuditLogs(ctx, arg) |
| 1821 | } |
| 1822 | prep, err := prepareSQLFilter(ctx, q.auth, policy.ActionRead, rbac.ResourceAuditLog.Type) |
| 1823 | if err != nil { |
| 1824 | return 0, xerrors.Errorf("(dev error) prepare sql filter: %w", err) |
| 1825 | } |
| 1826 | return q.db.CountAuthorizedAuditLogs(ctx, arg, prep) |
| 1827 | } |
| 1828 | |
| 1829 | func (q *querier) CountConnectionLogs(ctx context.Context, arg database.CountConnectionLogsParams) (int64, error) { |
| 1830 | // Just like the actual query, shortcut if the user is an owner. |
no test coverage detected