Member Junction
    Preparing search index...

    SECURITY — screens for SQL text that a client (or a client-saved record) supplies to RunView.

    ClientClauseScreen.AssertClauseUsesEntityBaseViews is the full screen: one statement, parsed as a read-only fragment, that calls no function the dialect forbids in caller SQL and whose table references are only entity base views the acting user can read unscoped (no row filter and no denied fields). Base tables and system catalogs are refused. Apply it at every point where client text enters RunView: the GraphQL and REST entry points, ad-hoc list sources, and the clauses a saved view stores (at save and when the view runs).

    ClientClauseScreen.AssertSingleStatementFragment is the light check the provider runs on every RunView, server-internal ones included: no statement separator and no comment outside a literal or quoted identifier. It cannot refuse a legitimate fragment, so it is safe for callers whose filters the full screen would refuse (base tables, entities the acting user cannot read).

    Both use dialect-aware lexing, so a quote inside a bracket identifier ([a']) or a PostgreSQL E'\'' string cannot hide a statement the way it hides one from the keyword denylist.

    Index

    Constructors

    Methods

    • The full screen for one client clause fragment; throws when it refuses. The label OrderBy screens the text as an ORDER BY list; any other label screens it as a WHERE predicate. When user is given, every entity the fragment reads must be readable by that user, unscoped (AssertUnscopedRead). That includes the entity the clause filters: a subquery over its base view is outside the row filter RunView applies to the outer query.

      The reads come from a walk of the whole parse tree (CollectStatementReads), and the clause is refused when that walk does not account for every SELECT in the text (AssertEverySelectAccountedFor). Only the parse wrapper's own FROM item is skipped, and no CTE reference is exempt. A name reserved for the parser (AssertNoIdentifierAliasNames) and a call to a function the dialect forbids (AssertNoForbiddenFunctionCalls) are refused first.

      With LeaveUnparseableToProvider, text the parser cannot read returns without a refusal; the caller's own per-item check must refuse it instead.

      Parameters

      Returns void

    • Screens a full client-supplied SQL statement (ad-hoc query path) so every table reference resolves to an entity BaseView that user can read unscoped (CanRead, no row-level filter, no denied fields), with in-scope CTE references permitted.

      Parameters

      Returns void

    • Refuses a statement separator or a comment outside literals and quoted identifiers. A filter or sort fragment never needs either, so this cannot refuse a legitimate clause.

      Parameters

      Returns void

    • The full screen for a whole caller-written statement (ad-hoc SQL), run on the SQL as it will execute: one read statement, no write or DDL at any depth, no name reserved for the parser, every SELECT accounted for, and every FROM item that is not a CTE in scope an entity base view user can read unscoped (AssertUnscopedRead). Base tables, system catalogs and table functions are refused. Throws on the first refusal.

      Parameters

      Returns void

    • Resolves a table reference against the allow-list and returns its entity; throws when it is not an entity base view, or when user is given and lacks CanRead on that entity.

      A schema-qualified reference, dbo included, must match an entity in that exact schema. An unqualified one resolves only when the view name is unique across schemas, because the database's default-schema resolution, not this screen, would pick which view runs.

      Parameters

      Returns EntityInfo

    • Refuses an entity whose read user holds under a row filter (role row-level security or an API-key row filter) or with denied fields. SQL that reads the entity's base view directly, such as a subquery in a client clause or an ad-hoc query, applies neither; RunView on that entity does. For any other entity, a granted read covers every row and field of its base view.

      Parameters

      Returns void

    • Builds the base-view allow-list for a set of entities, including both each entity's canonical BaseView and any registered, usable AlternateBaseViews (D13). Disabled alternate base views (!abv.IsUsable) are excluded. Canonical BaseView entries are registered first and never overwritten by alternate base views; cross-entity collisions on (schema, viewName) map to null (fail-closed). Memoized per entity array: reused while the array keeps its length and no EntityInfo has been built since (the field-security generation, which moves on every build, so a refreshed or replaced entity is noticed).

      Parameters

      Returns EntityBaseViewAllowList