Skip to content

Commit

Permalink
Defaultgdprscope (#657)
Browse files Browse the repository at this point in the history
* changes to handle gdpr null case

* GDPR namespace undefined check added

* undefined check in consent management

* Logs added for privacy gdpr checks

* Used Template literals

---------

Co-authored-by: Manasi Moghe <[email protected]>
  • Loading branch information
pm-nitin-nimbalkar and pm-manasi-moghe authored May 2, 2023
1 parent 88084ab commit a7124c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modules/userId/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,9 @@ function initSubmodules(dest, submodules, consentData, forceRefresh = false) {

// another consent check, this time each module is checked for consent with its own gvlid
let { userIdModules, hasValidated } = validateGdprEnforcement(submodules, consentData);
logWarn("Privacy - Logging userIds allowed for syncup - "+userIdModules);
logWarn("Privacy - Logging hasValidated flag - "+hasValidated);
logWarn("Privacy - Logging consentData received - "+consentData);
logWarn(`Privacy - Logging userIds allowed for syncup - ${userIdModules}`);
logWarn(`Privacy - Logging hasValidated flag - ${hasValidated}`);
logWarn(`Privacy - Logging consentData received - ${consentData}`);
if (!hasValidated && !hasPurpose1Consent(consentData)) {
logWarn(`${MODULE_NAME} - gdpr permission not valid for local storage or cookies, exit module`);
return [];
Expand Down
6 changes: 3 additions & 3 deletions src/utils/gpdr.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {deepAccess, logWarn} from '../utils.js';
* @returns {boolean} true if the gdprConsent is null-y; or GDPR does not apply; or if purpose 1 consent was given.
*/
export function hasPurpose1Consent(gdprConsent) {
logWarn("Privacy - checking purpose1Consent - "+gdprConsent);
logWarn(`Privacy - checking purpose1Consent - ${gdprConsent}`);
if(gdprConsent === null) {
logWarn("Privacy - gdprConsent is null, checking value of defaultGdprScope = "+owpbjs?.getConfig().consentManagement?.gdpr?.defaultGdprScope);
logWarn(`Privacy - gdprConsent is null, checking value of defaultGdprScope = ${owpbjs?.getConfig().consentManagement?.gdpr?.defaultGdprScope}`);
return !(owpbjs?.getConfig().consentManagement?.gdpr?.defaultGdprScope === true)
}
if (gdprConsent?.gdprApplies) {
logWarn("Privacy - gdprConsent?.gdprApplies = "+gdprConsent?.gdprApplies+" and purpose consent = "+gdprConsent.vendorData.purpose.consents);
logWarn(`Privacy - gdprConsent?.gdprApplies = ${gdprConsent?.gdprApplies} and purpose consent = ${gdprConsent.vendorData.purpose.consents}`);
return deepAccess(gdprConsent, 'vendorData.purpose.consents.1') === true;
}
return true;
Expand Down

0 comments on commit a7124c4

Please sign in to comment.