Initial reliable release of consent engine
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Universal Cookie Consent
|
||||
* jurisdiction/policies.js
|
||||
*
|
||||
* Declarative policy catalog.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* These entries identify policy families only. They are NOT legal advice and
|
||||
* deliberately do not encode detailed legal requirements yet. Those rules
|
||||
* will be added after current-source legal research and policy review.
|
||||
*/
|
||||
|
||||
const freeze = (value) => Object.freeze(value);
|
||||
|
||||
export const POLICIES = Object.freeze({
|
||||
"global-baseline": freeze({
|
||||
id: "global-baseline",
|
||||
family: "global",
|
||||
version: "1.0",
|
||||
description: "Conservative global baseline pending jurisdiction-specific policy."
|
||||
}),
|
||||
|
||||
"us-state-privacy": freeze({
|
||||
id: "us-state-privacy",
|
||||
family: "us-state",
|
||||
version: "1.0",
|
||||
description: "Policy family for U.S. state privacy regimes."
|
||||
}),
|
||||
|
||||
"us-california-privacy": freeze({
|
||||
id: "us-california-privacy",
|
||||
family: "us-state",
|
||||
version: "1.0",
|
||||
description: "Policy family reserved for California-specific requirements."
|
||||
}),
|
||||
|
||||
"eu-privacy": freeze({
|
||||
id: "eu-privacy",
|
||||
family: "eu",
|
||||
version: "1.0",
|
||||
description: "Policy family reserved for applicable European privacy requirements."
|
||||
})
|
||||
});
|
||||
|
||||
export function getPolicy(policyId) {
|
||||
if (typeof policyId !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return POLICIES[policyId] || null;
|
||||
}
|
||||
|
||||
export function hasPolicy(policyId) {
|
||||
return Boolean(getPolicy(policyId));
|
||||
}
|
||||
Reference in New Issue
Block a user