@@ -18,8 +18,6 @@ const TCF2 = {
18
18
'purpose7' : { id : 7 , name : 'measurement' }
19
19
}
20
20
21
- const VENDORLESS_MODULE_TYPES = [ 'fpid-module' ] ;
22
-
23
21
/*
24
22
These rules would be used if `consentManagement.gdpr.rules` is undefined by the publisher.
25
23
*/
@@ -125,10 +123,9 @@ function getGvlidForAnalyticsAdapter(code) {
125
123
* @param {Object } consentData - gdpr consent data
126
124
* @param {string= } currentModule - Bidder code of the current module
127
125
* @param {number= } gvlId - GVL ID for the module
128
- * @param {string= } moduleType module type
129
126
* @returns {boolean }
130
127
*/
131
- export function validateRules ( rule , consentData , currentModule , gvlId , moduleType ) {
128
+ export function validateRules ( rule , consentData , currentModule , gvlId ) {
132
129
const purposeId = TCF2 [ Object . keys ( TCF2 ) . filter ( purposeName => TCF2 [ purposeName ] . name === rule . purpose ) [ 0 ] ] . id ;
133
130
134
131
// return 'true' if vendor present in 'vendorExceptions'
@@ -141,14 +138,12 @@ export function validateRules(rule, consentData, currentModule, gvlId, moduleTyp
141
138
const vendorConsent = deepAccess ( consentData , `vendorData.vendor.consents.${ gvlId } ` ) ;
142
139
const liTransparency = deepAccess ( consentData , `vendorData.purpose.legitimateInterests.${ purposeId } ` ) ;
143
140
144
- const vendorlessModule = includes ( VENDORLESS_MODULE_TYPES , moduleType ) ;
145
-
146
141
/*
147
142
Since vendor exceptions have already been handled, the purpose as a whole is allowed if it's not being enforced
148
143
or the user has consented. Similar with vendors.
149
144
*/
150
145
const purposeAllowed = rule . enforcePurpose === false || purposeConsent === true ;
151
- const vendorAllowed = rule . enforceVendor === false || vendorConsent === true || vendorlessModule === true ;
146
+ const vendorAllowed = rule . enforceVendor === false || vendorConsent === true ;
152
147
153
148
/*
154
149
Few if any vendors should be declaring Legitimate Interest for Device Access (Purpose 1), but some are claiming
@@ -167,16 +162,15 @@ export function validateRules(rule, consentData, currentModule, gvlId, moduleTyp
167
162
* @param {Function } fn reference to original function (used by hook logic)
168
163
* @param {Number= } gvlid gvlid of the module
169
164
* @param {string= } moduleName name of the module
170
- * @param {string= } moduleType module type
171
165
*/
172
- export function deviceAccessHook ( fn , gvlid , moduleName , moduleType , result ) {
166
+ export function deviceAccessHook ( fn , gvlid , moduleName , result ) {
173
167
result = Object . assign ( { } , {
174
168
hasEnforcementHook : true
175
169
} ) ;
176
170
if ( ! hasDeviceAccess ( ) ) {
177
171
logWarn ( 'Device access is disabled by Publisher' ) ;
178
172
result . valid = false ;
179
- fn . call ( this , gvlid , moduleName , moduleType , result ) ;
173
+ fn . call ( this , gvlid , moduleName , result ) ;
180
174
} else {
181
175
const consentData = gdprDataHandler . getConsentData ( ) ;
182
176
if ( consentData && consentData . gdprApplies ) {
@@ -188,19 +182,19 @@ export function deviceAccessHook(fn, gvlid, moduleName, moduleType, result) {
188
182
gvlid = getGvlid ( moduleName ) || gvlid ;
189
183
}
190
184
const curModule = moduleName || curBidder ;
191
- let isAllowed = validateRules ( purpose1Rule , consentData , curModule , gvlid , moduleType ) ;
185
+ let isAllowed = validateRules ( purpose1Rule , consentData , curModule , gvlid ) ;
192
186
if ( isAllowed ) {
193
187
result . valid = true ;
194
- fn . call ( this , gvlid , moduleName , moduleType , result ) ;
188
+ fn . call ( this , gvlid , moduleName , result ) ;
195
189
} else {
196
190
curModule && logWarn ( `TCF2 denied device access for ${ curModule } ` ) ;
197
191
result . valid = false ;
198
192
storageBlocked . push ( curModule ) ;
199
- fn . call ( this , gvlid , moduleName , moduleType , result ) ;
193
+ fn . call ( this , gvlid , moduleName , result ) ;
200
194
}
201
195
} else {
202
196
result . valid = true ;
203
- fn . call ( this , gvlid , moduleName , moduleType , result ) ;
197
+ fn . call ( this , gvlid , moduleName , result ) ;
204
198
}
205
199
}
206
200
}
0 commit comments