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

Method GetAuditLogsOffset

coderd/database/dbauthz/dbauthz.go:2743–2757  ·  view source on GitHub ↗
(ctx context.Context, arg database.GetAuditLogsOffsetParams)

Source from the content-addressed store, hash-verified

2741}
2742
2743func (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
2759func (q *querier) GetAuthenticatedWorkspaceAgentAndBuildByAuthToken(ctx context.Context, authToken uuid.UUID) (database.GetAuthenticatedWorkspaceAgentAndBuildByAuthTokenRow, error) {
2760 // This is a system function.

Callers 1

Calls 5

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

Tested by

no test coverage detected