Skip to contents

Scans data objects for possible real names when package masking is enabled. This is an exact-match technical check, not a legal or institutional compliance determination. It stops processing when configured names are found.

Usage

validate_privacy_compliance(
  data = NULL,
  privacy_level = getOption("engager.privacy_level", "mask"),
  real_names = NULL,
  stop_on_violation = TRUE
)

Arguments

data

Data frame or object to inspect for possible identifier exposure

privacy_level

Privacy level to validate against. One of c("privacy_strict", "privacy_standard", "mask", "none"). Defaults to getOption("engager.privacy_level", "mask"). Deprecated aliases "ferpa_strict" and "ferpa_standard" are accepted with a warning.

real_names

Vector of real names to check against. If NULL, uses common name patterns to detect potential violations.

stop_on_violation

Whether to stop processing if violations are found. Defaults to TRUE for maximum privacy protection.

Value

The logical scalar TRUE when the technical check finds no configured real names. The function raises an error instead when a blocking exposure is found.

Examples

# Validate privacy compliance
df <- tibble::tibble(
  name = c("Student_01", "Student_02"),
  score = c(85, 92)
)
validate_privacy_compliance(df)
#> [1] TRUE

# Check with specific real names
real_names <- c("John Smith", "Jane Doe")
validate_privacy_compliance(df, real_names = real_names)
#> [1] TRUE