fix(security): skip loading security rules if disabled

This commit is contained in:
2026-09-20 15:52:25 +02:00
parent 87eaa9e18c
commit 817b781c88
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -254,6 +254,15 @@ func ShouldSkipRowSecurity(secCtx SecurityContext, operation string) bool {
return rules.SecurityDisabled || (operation == "read" && rules.CanPublicRead)
}
// IsModelSecurityDisabled reports whether all model-level security processing
// is disabled for the model. This is distinct from ShouldSkipRowSecurity:
// CanPublicRead skips row filtering for reads but must still allow other read
// security, such as column masking, to be loaded.
func IsModelSecurityDisabled(secCtx SecurityContext) bool {
rules, ok := resolveModelRules(secCtx)
return ok && rules.SecurityDisabled
}
// ApplyColumnSecurity is a public wrapper for applyColumnSecurity that accepts a SecurityContext
// This allows other packages to apply column-level security using the generic interface
func ApplyColumnSecurity(secCtx SecurityContext, securityList *SecurityList) error {