Class FieldAccessHelper
java.lang.Object
com.kingsrook.qqq.backend.core.actions.permissions.fieldaccess.FieldAccessHelper
Single entry point for field policy, enforcement, masking and audit notifications.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPer-invocation exact searches, completed only by the action that enforced them. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyToAuditDetails(String tableName, List<QRecord> auditDetails) Mask historical values without honoring reveal grants.static voidapplyToProcessRecords(String processName, String fallbackTable, List<QRecord> records) Process records can belong to different tables, independently of the process.static voidMask once, recursively, and emit one value-free view event per table.static QTableMetaDataapplyToTable(QTableMetaData table) Clone only when restricting metadata; do not expose restricted defaults.assertCriteriaAllowed(String tableName, List<QueryJoin> joins, QQueryFilter filter, Collection<String> sortGroupAggregateFieldNames) Check filters and ordering before querying; successful exact searches are audited once per table.assertCriteriaAllowed(String tableName, List<QueryJoin> joins, QQueryFilter filter, Collection<String> sortGroupAggregateFieldNames, boolean checkExactMatch) Criteria-only mode has no fingerprints, guardrail callbacks or audit events.static voidassertSelectedFieldsAllowed(String tableName, List<QueryJoin> joins, Collection<String> names) Selecting masks is allowed; explicit selection of a HIDDEN field retains the legacy denial.static voidassertWritesAllowed(QTableMetaData table, List<QRecord> records) Refuse supplied values, including explicit null, for non-FULL fields.static booleancanFilter(QTableMetaData table, String fieldName, QCriteriaOperator operator) Whether the policy permits this filter operator, including enumeration restrictions.static StringStable fingerprint of the resolver, channel and effective restrictions.static FieldAccessDecisiongetDecision(QTableMetaData table, QFieldMetaData field) Combine locks, cached resolver decisions and the channel ceiling.static FieldAccessTiergetLockTier(QFieldMetaData field) Evaluate the legacy override flip and all-access keys.static FieldAccessTiergetTier(QTableMetaData table, String fieldName) Effective access for a real or virtual field.static Map<String, FieldAccessTier> getTiers(QTableMetaData table) Access for real and virtual fields, in metadata order.static booleanLabels must contain only fields that are fully readable.
-
Field Details
-
CACHE_KEY
-
-
Method Details
-
getTier
Effective access for a real or virtual field. -
getDecision
Combine locks, cached resolver decisions and the channel ceiling. Never cache reveal grants. Primary keys are exempt from every policy ceiling. -
getLockTier
Evaluate the legacy override flip and all-access keys. -
getTiers
Access for real and virtual fields, in metadata order. -
getAccessFingerprint
Stable fingerprint of the resolver, channel and effective restrictions. -
assertCriteriaAllowed
public static FieldAccessHelper.PendingExactMatch assertCriteriaAllowed(String tableName, List<QueryJoin> joins, QQueryFilter filter, Collection<String> sortGroupAggregateFieldNames) throws QPermissionDeniedException Check filters and ordering before querying; successful exact searches are audited once per table.- Throws:
QPermissionDeniedException
-
assertCriteriaAllowed
public static FieldAccessHelper.PendingExactMatch assertCriteriaAllowed(String tableName, List<QueryJoin> joins, QQueryFilter filter, Collection<String> sortGroupAggregateFieldNames, boolean checkExactMatch) throws QPermissionDeniedException Criteria-only mode has no fingerprints, guardrail callbacks or audit events.- Throws:
QPermissionDeniedException
-
applyToTable
Clone only when restricting metadata; do not expose restricted defaults. -
assertWritesAllowed
public static void assertWritesAllowed(QTableMetaData table, List<QRecord> records) throws QPermissionDeniedException Refuse supplied values, including explicit null, for non-FULL fields.- Throws:
QPermissionDeniedException
-
applyToRecords
-
applyToProcessRecords
-
assertSelectedFieldsAllowed
public static void assertSelectedFieldsAllowed(String tableName, List<QueryJoin> joins, Collection<String> names) throws QPermissionDeniedException Selecting masks is allowed; explicit selection of a HIDDEN field retains the legacy denial.- Throws:
QPermissionDeniedException
-
canFilter
Whether the policy permits this filter operator, including enumeration restrictions. -
isRecordLabelFullAccess
Labels must contain only fields that are fully readable. -
applyToAuditDetails
-