[Canon] Per-graph permissions (read, use, approve) and default grant review
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 24/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- sql, typescript
- Área
- authorization, backend, databases, security
Línea de trabajo
Start by reading plans/canon-master-plan.md Workstream 5 and the referenced SearchScopePermissionResolver.ts to understand the existing permission model. The issue identifies GraphEngine.ts, CanonGraphEngine.ts, the graph entity servers, Explorer, and the v6.2.x graph migration as affected areas, and calls for a separate plan covering schema, resolution, enforcement, caching, and Explorer updates. Done means per-graph Read, Use, and Approve access is enforced across the listed entry points, with the default grants and caching reviewed; the open design questions need resolution first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What should Canon do that it does not do today?
Add per-graph permissions (Read, Use, Approve) modeled on MJ: Search Scope Permissions (SearchScopePermissionResolver), and review/tighten today's wide default grants across all MJ: Graph* entities so callers, agents, skills, and graph stewards can only read, traverse, or approve graphs they are authorized for.
Who needs it, and what goes wrong without it?
Today graph access is binary across the whole instance: Graph: Approve Edges is global across every graph, and every node/edge read relies solely on row-level permissions of the referenced target entities. In multi-tenant or multi-domain hosts (such as Betty hosting one Canon graph per customer organization alongside platform graphs):
- A customer org admin cannot be granted permission to approve concepts or edges in their own organization's graph without handing them global
Graph: Approve Edgesacross every tenant's graph. GraphEnginehas no graph-levelReadorUsecheck before traversing a graph (Subgraph), running an agent/skill against it, or loading it in Explorer — so an organization's graph metadata or unanchored concepts/edges can be inspected or traversed across domain boundaries unless the host builds custom middleware.migrations/v6/V202611022300__v6.2.x__Semantic_Graph_And_Graph_Concepts.sqlseeds wide defaultAllowgrants:UI(E0AFCCEC-6A37-EF11-86D4-000D3A4E707E) holds unfilteredCanRead = 1onMJ: Graphs,MJ: Graph Concepts,MJ: Graph Edges,MJ: Graph Types,MJ: Graph Concept Types,MJ: Graph Authority Tiers,MJ: Graph Edge Types,MJ: Graph Edge Type Endpoints, andMJ: Graph Edge Providers, whileDeveloper(DEAFCCEC-...) andIntegration(DFAFCCEC-...) hold unfiltered1/1/1/1; andGraphEngine.Config()(packages/MJCoreEntities/src/graph/GraphEngine.ts:241-250) bulk-caches all eight tables withCacheLocal: truein every browser and server process.
Which layer does it touch?
- Governed data slices (alternate base views, queries)
- Concepts and authority (graph concepts, edges, tiers)
- Agent guardrails (canonical notes)
- Executable procedures (skills, actions, workflows)
- Schema (a new type, status, tier, edge type or column)
What existing work is it related to?
plans/canon-master-plan.md— Workstream 5 (5b)- Workstream
5a(MJGraphConceptEntityServer+GraphEngine.CanUserApproveGraph) packages/SearchEngine/src/permissions/SearchScopePermissionResolver.ts(reference permission-resolver model)migrations/v6/V202611022300__v6.2.x__Semantic_Graph_And_Graph_Concepts.sql(default grants)packages/MJCoreEntities/src/graph/GraphEngine.ts&packages/MJCoreEntities/src/engines/CanonGraphEngine.ts
Rough size
Large (needs its own plan / schema migration + resolver + engine + Explorer updates).
Design Sketch
1. Schema & Permission Model (MJ: Graph Permissions)
Mirror __mj.SearchScopePermission cleanly (decided at monthly review + schema review before migration):
__mj.GraphPermission(MJ: Graph Permissions):ID uniqueidentifier NOT NULL PKGraphID uniqueidentifier NOT NULL FK -> __mj.Graph(ID)UserID uniqueidentifier NULL FK -> __mj.User(ID)andRoleID uniqueidentifier NULL FK -> __mj.Role(ID)withCK_GraphPermission_Principalrequiring(UserID IS NOT NULL AND RoleID IS NULL) OR (UserID IS NULL AND RoleID IS NOT NULL)(matchingSearchScopePermission, unless denied explicitly)PermissionLevel nvarchar(20) NOT NULL CHECK (PermissionLevel IN ('None', 'Read', 'Use', 'Approve'))(Approve > Use > Read > None;'None'is an explicit deny overriding role grants for that graph/principal)PrimaryScopeRecordID nvarchar(450) NULL+StartsAt datetimeoffset NULL/EndsAt datetimeoffset NULLfor optional tenant/org scoping and time-boxed grants (matchingMJSearchScopePermission)
- Agent, Skill & Host RunScope Alignment (matching
AIAgent.SearchScopeAccess/AISkill.SearchScopeAccess/RunActionParams.RunScope.SearchScopeIDs):- Add
AIAgent.GraphAccess nvarchar(20) NULL CHECK IN ('None', 'Assigned', 'All')(NULLbehaves as'None'or explicit default decision at review), join entityMJ: AI Agent Graphs, and siblingAISkill.GraphAccess/MJ: AI Skill Graphs. - Support
RunActionParams.RunScope.GraphIDs?: readonly string[]so a host (e.g., workspace/tenant/channel) can narrow which graphs an agent run may reach without ever widening past the calling user's ownGraphPermission.
- Add
2. Replaceable GraphPermissionResolver (@RegisterClass Extension Point)
Follow the exact lesson captured in SearchScopePermissionResolver.ts:35:
- Ship
GraphPermissionResolver(BaseSingleton<GraphPermissionResolver>registered via@RegisterClassor DI lookup on@memberjunction/core-entities-server) evaluating a fail-closed decision tree for{ User, GraphID, Agent, Skill, PrimaryScopeRecordID, HostAssignedGraphIDs }:- Direct
UserIDgrant (explicit'None'denies regardless of role grants) - Role grant across
User.UserRoles(Approve > Use > Read; explicit'None'overrides lower grants unless higher explicit user allow — pin exact deny-wins precedence matchingSearchScopePermissionResolver) - Agent / Skill
GraphAccess('None'rejects;'Assigned'requires listing;'All'acts only as fallback/intersection, never overriding an explicit'None') - Default
'NoGrant'-> denied (Allowed: false, Level: 'None')
- Direct
- Make
GraphPermissionResolversubclassable via@RegisterClassso multi-tenant hosts (e.g., Betty usingbetty.Graph.OrganizationID+BCAuthorizationEngineorg-admin tier) resolveApprovefor an org admin on their own org's graph directly from host tenant/entitlement state without duplicating per-user permission rows.
3. Enforcement Seams
- Read (
Level >= 'Read'): Graph metadata, concepts, edges, and Explorer visualization (SemanticGraphExplorerComponent) refuse or withhold graphs where the caller lacksRead. Add RLS/PreRunView alignment or entity-server read enforcement rather than relying solely on client filtering. - Use (
Level >= 'Use'):GraphEngine.Subgraph,CanonGraphEngine.FindConcepts/CanonContext/ExplainConcept/ExplainEntity, and graph tools/actions (Get Graph Context,Resolve Concepts,Find Graph Path,Explain Concept) filter candidate graphs to those where[caller, ...AudienceReaders]all holdUse. - Approve (
Level === 'Approve'): UpdateMJGraphConceptEntityServer(5a) andMJGraphEdgeEntityServerso approval/deprecation/rejection/governed-edits succeed if the caller holdsGraph: Approve Edges(global platform steward /Owneroverride) ORGraphPermissionResolver.CanApproveGraph(user, graphID, provider)returnsApprove(except insideGRAPH_PIPELINE_EDGE_APPROVAL_OPERATIONcreates). Explorer (SemanticGraphExplorerComponent.CanApproveSelectedGraph) queries/checks the selected graph's effective permission rather than only checking the global authorization.
4. Default Grant & Caching Audit (V202611022300 & GraphEngine.Config())
Audit and plan backward-compatible tightening in the migration + code:
- Reference catalogs (
MJ: Graph Types,MJ: Graph Concept Types,MJ: Graph Authority Tiers,MJ: Graph Edge Types,MJ: Graph Edge Type Endpoints): static global vocabularies;UICanRead = 1is benign. - Instance / Tenant-bearing entities (
MJ: Graphs,MJ: Graph Concepts,MJ: Graph Edges,MJ: Graph Edge Providers): todayUIholds unfilteredCanRead = 1on all four, allowing directRunViewagainst/graphqlby anyUIuser to read all rows across every graph! Add documented RLS filters (RowLevelSecurityFilter) or graph-permission-aware server read scoping (MJGraph*EntityServer/ProviderBasehook) so directRunViewrespectsGraphPermission(Read) even outsideGraphEngine. GraphEngine.Config()(CacheLocal: true): Stop unconditionally caching the entireMJ: Graph Conceptstable (CacheLocal: true) in every browser client; loadOnDemandgraphs' concepts server-side/per-graph and cache only public/permittedPreloadgraphs ("MJ Canon"), keyed appropriately.
5. Open Questions for Dec 3 Canon Review
- Should
UIcontinue having read access to"MJ Canon"by default via a seededGraphPermissionrow on"MJ Canon"for theUIrole (Level = 'Use'), while newly created graphs default to private (NoGrant)? - Should
Graph: Approve Edgesremain as the global platform steward override alongside per-graphApprove, or be deprecated onceMJ: Graph Permissionsships? - When
SearchScope+Graphare paired in an agent run, shouldAISkill.SearchScopeAccessandAISkill.GraphAccessshare oneRunScopecheck pattern?
- Lenguaje dominante
- TSQL
- Estrellas
- 32
- Forks
- 7
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 504
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
MemberJunction/MJ#7094 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
MemberJunction/MJ#6971 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
MemberJunction/MJ#6947 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MemberJunction/MJ#6800 ·
Los mantenedores suelen responder en 1 día
-
Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draftAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MemberJunction/MJ#6746 ·
Los mantenedores suelen responder en 1 día
Todos los issues de MemberJunction/MJ
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
samkerrcode/opengent#113 ·
Los mantenedores suelen responder en 1 día
-
CVE-2026-139999 react-routerAbiertoarea/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
OHDSI/Data2Evidence#3795 ·
Los mantenedores suelen responder en 3 días
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sharkohark1234/redact-sensitive#120 ·
Los mantenedores suelen responder en 1 día
-
bug vault
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
bancolombia/secrets-manager#150 ·
Los mantenedores suelen responder en 1 día