(ctx context.Context, chatIDs []uuid.UUID)
| 2968 | } |
| 2969 | |
| 2970 | func (q *querier) GetChatDiffStatusesByChatIDs(ctx context.Context, chatIDs []uuid.UUID) ([]database.ChatDiffStatus, error) { |
| 2971 | if len(chatIDs) == 0 { |
| 2972 | return []database.ChatDiffStatus{}, nil |
| 2973 | } |
| 2974 | |
| 2975 | actor, ok := ActorFromContext(ctx) |
| 2976 | if ok && actor.Type == rbac.SubjectTypeSystemRestricted { |
| 2977 | return q.db.GetChatDiffStatusesByChatIDs(ctx, chatIDs) |
| 2978 | } |
| 2979 | |
| 2980 | for _, chatID := range chatIDs { |
| 2981 | // Authorize read on each parent chat. |
| 2982 | _, err := q.GetChatByID(ctx, chatID) |
| 2983 | if err != nil { |
| 2984 | return nil, err |
| 2985 | } |
| 2986 | } |
| 2987 | |
| 2988 | return q.db.GetChatDiffStatusesByChatIDs(ctx, chatIDs) |
| 2989 | } |
| 2990 | |
| 2991 | func (q *querier) GetChatExploreModelOverride(ctx context.Context) (string, error) { |
| 2992 | if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceDeploymentConfig); err != nil { |
nothing calls this directly
no test coverage detected