Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draft
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
この issue の規約とサーフェス一覧表を、参照されているパス query-browser-resource.component.ts、search-query-catalog.action.ts、MentionAutocomplete.ts とあわせて読みます。ステータスフィルターと記載された例外を現在のコードと照合し、文書化されたルールとサーフェス一覧を正確に保ちます。新しいクエリ一覧表示サーフェスが Approved versus Pending の規約に従えるようになり、却下された権限付与のアプローチが明確に記録されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Agents and users can now save queries from a conversation (#6743: a list made in chat saves its SQL as a query so the list can refresh). That makes MJ: Queries a table ordinary users write to, which it wasn't before, and MJ has no written rule about which saved queries are offered to whom.
This issue records the rule we adopted and the three mechanisms that are not the answer, so the next surface that lists queries stays in line.
The convention
Approved means MJ canon; Pending means a draft that belongs to whoever saved it.
- Approved queries are discoverable by agents, composable into other queries, and surfaced in search and pickers.
- Pending queries run — a list refreshes from one, and
RunQueryonly warns on a non-Approved status — but are not offered on shared surfaces. - Approval is the owner's act, and it is what promotes a draft into canon.
This matches what already shipped elsewhere: SkillSmith persists AI Skills as Pending for review, and Search Query Catalog is approvedOnly by default.
It is a discovery boundary, not access control. A Pending query is still runnable by anyone who can read the entities it reads (MJQueryEntityExtended.UserCanRun falls through to entity CanRead when a query has no permission rows), and every run is bounded by that user's own field-level security. Nothing about this hides data; it keeps other people's drafts out of lists, pickers and agent context.
Surfaces that must honour it
Checked on next at 1f821e2:
| Surface | State |
|---|---|
| Query Browser tree | Already defaults 'Pending': false (query-browser-resource.component.ts:179) |
Search Query Catalog action |
Already approvedOnly by default (search-query-catalog.action.ts:44) |
Research Agent AVAILABLE_QUERIES |
Already Status = 'Approved' |
Model Development APPROVED_QUERIES |
Already Status = 'Approved' |
Query Strategist REUSABLE_QUERIES |
Already Reusable = 1 AND Status = 'Approved' |
Query Builder ALL_QUERIES |
Status = 'Approved' OR Status = 'Pending', with SQL — the one exception; narrowed in #6743 |
#query mention autocomplete |
No status test at all (MentionAutocomplete.ts:191) — fixed in #6743 |
Anything new that lists saved queries belongs in this table.
What is not the answer, and why
MJ: Query Permissions— role-only (QueryPermissionProvider.SupportedGranteeTypes = ['Role']), and a role list overrides the entity read checks (stored-procedure semantics,MJQueryEntityExtended.UserCanRunstep 2). Adding rows to make a query private widens access instead.- RLS on
MJ: Queries—UserExemptFromRowLevelSecurity(entityInfo.ts:5581) means a user holding any role with an unfiltered Read grant gets no filter at all, so this only works if the unfiltered grant is stripped from every role in every installation. It also wouldn't restrict execution, since server-side query resolution runs as the system user by design. - A visibility column on
MJ: Query Categories—UserIDthere is "created by" and NOT NULL, so it can't be repurposed, and a bespoke column would be a third mechanism besideMJ: Resource Permissions(whereQueriesis already a registered resource type) and theMJ: Search Scope Permissionsshape.
If we want real per-principal query permissions
Do it once, as its own piece of work, in the MJ: Search Scope Permissions / proposed MJ: Graph Permissions shape from #6723: a UserID-or-RoleID principal with a PermissionLevel that includes an explicit None deny. That would need an owner column on MJ: Queries (today the entity has only ApprovedByUserID), and it is also the prerequisite for letting a gated action save a draft on a user's behalf — without it, such a query is unattributed in Record Changes and its owner can neither edit, delete nor approve it.
Related
- #6743 — lists from queries and conversations (first consumer; narrows
ALL_QUERIESand the mention list) - #6642 — list refresh from a saved view or query
- #3485 — least-privilege filtering of client-shipped metadata; its item 4 is saved-query SQL. Partly stale:
LoadQueryMetadatanow defaults off and the provider sends1=0item filters for the whole query family (providerBase.ts:1071), so query SQL no longer rides theMJ_Metadatadataset by default - #6723 — per-graph permissions; the reference shape for per-principal resource permissions
- 主要言語
- TSQL
- スター
- 32
- フォーク
- 7
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 504
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MemberJunction/MJ のほかの issue
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
MemberJunction/MJ#7094 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
MemberJunction/MJ#6971 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
MemberJunction/MJ#6947 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MemberJunction/MJ#6800 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MemberJunction/MJ#6721 ·
メンテナーはふだん 1 日以内に返信
MemberJunction/MJ の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OHDSI/Data2Evidence#3815 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
roc-lang/basic-webserver#277 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
redhat-developer/rhdh-plugin-export-overlays#4995 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
fidelity
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Azure SAS signing uses local time instead of UTC, shifting validity window on non-UTC hosts対応中かも @huanghaoyuanhhy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/milvus-backup#1418 ·
メンテナーはふだん 1 日以内に返信