集計で独裁者以外がほとんど検索条件を指定できないバグ (#444) (#452)

Reviewed-on: #452
Co-authored-by: miteruzo <miteruzo@naver.com>
このコミットはプルリクエスト #452 でマージされました。
このコミットが含まれているのは:
2026-11-09 00:03:26 +09:00
committed by みてるぞ
コミット f05d8a4b3a
10個のファイルの変更、528行の追加、57行の削除
+2 -10
ファイルの表示
@@ -220,19 +220,11 @@ class CountsTableQuery
private
# Public timeline predicates may include hidden records. Private predicates must
# never become a count oracle, even when the selected axes themselves are public.
# Private predicates require visibility independently of their operator.
# Ordering/measure state must not select a server-only masked coordinate.
def validate_summary_conditions!
return if mode != 'summary' || HistoryAccess.admin?
fields = QueryState.records(@params, 'conditions') + QueryState.records(@params, 'drill')
private_fields = fields.any? { !CountsAxes::PUBLIC_FIELDS.include?(_1['field']) }
keys = ['tags', 'tag', 'kind', 'resource_id', 'user_id']
private_parameters = keys.any? do |key|
@params.any? { |name, value| (name == key || name.start_with?("#{ key }.")) && value != '' }
end
raise CountsAxes::PrivateCondition if private_fields || private_parameters
['column_order', 'measures'].each do |key|
# Coordinates are compared only to already masked expressions, never raw
# values. Public coordinates remain sortable; a guessed private ID cannot match.