Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draft
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Leggi la convenzione e la tabella delle superfici in questa issue insieme ai percorsi citati query-browser-resource.component.ts, search-query-catalog.action.ts e MentionAutocomplete.ts. Verifica i filtri di stato e le eccezioni indicate rispetto al codice attuale, quindi mantieni accurati la regola documentata e l’inventario delle superfici. Il lavoro è completato quando le nuove superfici di elencazione delle query possono seguire la convenzione Approved versus Pending e gli approcci ai permessi rifiutati sono registrati chiaramente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TSQL
- Stelle
- 32
- Fork
- 7
- Merge medio
- 1g 16h
- PR unite (30g)
- 504
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
MemberJunction/MJ#7094 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
MemberJunction/MJ#6971 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MemberJunction/MJ#6947 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MemberJunction/MJ#6800 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MemberJunction/MJ#6721 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MemberJunction/MJ
Issue simili
-
HXsetdir strdup leakAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
funding: failure logs print `<nil>` error and zero channel IDForse già presa @litbot-9000 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
lightningnetwork/lnd#11676 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Fei2411/DeepSeek-Bot#2891 ·
-
factory:subtask
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno