(ctx context.Context, arg database.GetAuditLogsOffsetParams)
| 2741 | } |
| 2742 | |
| 2743 | func (q *querier) GetAuditLogsOffset(ctx context.Context, arg database.GetAuditLogsOffsetParams) ([]database.GetAuditLogsOffsetRow, error) { |
| 2744 | // Shortcut if the user is an owner. The SQL filter is noticeable, |
| 2745 | // and this is an easy win for owners. Which is the common case. |
| 2746 | err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceAuditLog) |
| 2747 | if err == nil { |
| 2748 | return q.db.GetAuditLogsOffset(ctx, arg) |
| 2749 | } |
| 2750 | |
| 2751 | prep, err := prepareSQLFilter(ctx, q.auth, policy.ActionRead, rbac.ResourceAuditLog.Type) |
| 2752 | if err != nil { |
| 2753 | return nil, xerrors.Errorf("(dev error) prepare sql filter: %w", err) |
| 2754 | } |
| 2755 | |
| 2756 | return q.db.GetAuthorizedAuditLogsOffset(ctx, arg, prep) |
| 2757 | } |
| 2758 | |
| 2759 | func (q *querier) GetAuthenticatedWorkspaceAgentAndBuildByAuthToken(ctx context.Context, authToken uuid.UUID) (database.GetAuthenticatedWorkspaceAgentAndBuildByAuthTokenRow, error) { |
| 2760 | // This is a system function. |
no test coverage detected