Class MetaQueryService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA saved query and its parsed definition, for a caller that inspects the definition before running it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckAccess(MetaQuery metaQuery) Validate that the current user may run the given query, and return the query to run.definition(String name) The named query and its definition, once the user is allowed to run it.resolve(MetaQueryService.SavedQuery saved, Map<String, Object> params, Integer limit, Integer offset, Integer maxRows) Runs a saved query already loaded withdefinition(String).resolve(MetaQueryService.SavedQuery saved, Map<String, Object> params, Integer limit, Integer offset, Integer maxRows, QueryAccess access) Runs a saved query held toaccessrather than to the current user's permissions alone, asQueryEngine.execute(Query, Map, Integer, Integer, Integer, QueryAccess)does.Runs a query that is not stored and wraps its result in the same envelope, with no source.Runs a query that is not stored, held toaccess.Runs a named query and wraps the result in the envelope presentation depends on.Runs a named query with the row cap tightened tomaxRows, asQueryEngine.execute(Query, Map, Integer, Integer, Integer)does.
-
Constructor Details
-
MetaQueryService
public MetaQueryService()
-
-
Method Details
-
execute
-
execute
-
execute
-
execute
-
execute
-
execute
-
resolve
public DatasetEnvelope resolve(String name, Map<String, Object> params, Integer limit, Integer offset) Runs a named query and wraps the result in the envelope presentation depends on.Built here because only this layer holds the query's metadata and its stored definition alongside the executor's window and applied parameters.
-
resolve
public DatasetEnvelope resolve(String name, Map<String, Object> params, Integer limit, Integer offset, Integer maxRows) Runs a named query with the row cap tightened tomaxRows, asQueryEngine.execute(Query, Map, Integer, Integer, Integer)does. -
resolve
public DatasetEnvelope resolve(MetaQueryService.SavedQuery saved, Map<String, Object> params, Integer limit, Integer offset, Integer maxRows) Runs a saved query already loaded withdefinition(String). -
resolve
public DatasetEnvelope resolve(MetaQueryService.SavedQuery saved, Map<String, Object> params, Integer limit, Integer offset, Integer maxRows, QueryAccess access) Runs a saved query held toaccessrather than to the current user's permissions alone, asQueryEngine.execute(Query, Map, Integer, Integer, Integer, QueryAccess)does. -
resolve
Runs a query that is not stored and wraps its result in the same envelope, with no source.There is no
MetaQuerywhose roles could apply, so access is the engine's own: the user must be able to read every model the query touches, and their row-level filters apply. -
resolve
public DatasetEnvelope resolve(Query query, Map<String, Object> params, Integer maxRows, QueryAccess access) Runs a query that is not stored, held toaccess. -
definition
The named query and its definition, once the user is allowed to run it. -
describe
-
checkAccess
Validate that the current user may run the given query, and return the query to run.The
metaQuerymay originate from an action context, whose roles and definition are both attacker-controlled. So the roles are checked on the persisted record, and the definition must be the persisted one: running the context's would let anyone allowed one saved query run any XML, and running the persisted one in its place would answer a question nobody asked.An administrator or technical staff member may run any definition, saved or not, so a query's roles do not restrict them either.
- Returns:
metaQueryfor such a user; otherwise the persisted query it names
-