(ctx context.Context, arg database.GetUserActivityInsightsParams)
| 4565 | } |
| 4566 | |
| 4567 | func (q *querier) GetUserActivityInsights(ctx context.Context, arg database.GetUserActivityInsightsParams) ([]database.GetUserActivityInsightsRow, error) { |
| 4568 | // Used by insights endpoints. Need to check both for auditors and for regular users with template acl perms. |
| 4569 | if err := q.authorizeContext(ctx, policy.ActionViewInsights, rbac.ResourceTemplate); err != nil { |
| 4570 | for _, templateID := range arg.TemplateIDs { |
| 4571 | template, err := q.db.GetTemplateByID(ctx, templateID) |
| 4572 | if err != nil { |
| 4573 | return nil, err |
| 4574 | } |
| 4575 | |
| 4576 | if err := q.authorizeContext(ctx, policy.ActionViewInsights, template); err != nil { |
| 4577 | return nil, err |
| 4578 | } |
| 4579 | } |
| 4580 | if len(arg.TemplateIDs) == 0 { |
| 4581 | if err := q.authorizeContext(ctx, policy.ActionViewInsights, rbac.ResourceTemplate.All()); err != nil { |
| 4582 | return nil, err |
| 4583 | } |
| 4584 | } |
| 4585 | } |
| 4586 | return q.db.GetUserActivityInsights(ctx, arg) |
| 4587 | } |
| 4588 | |
| 4589 | func (q *querier) GetUserAgentChatSendShortcut(ctx context.Context, userID uuid.UUID) (string, error) { |
| 4590 | user, err := q.db.GetUserByID(ctx, userID) |
nothing calls this directly
no test coverage detected