Add functions to get a list of publisher restrictions for purpose + check if vendor has consent or LI for a list of purposes

This commit is contained in:
Thomas LAY
2020-04-08 18:10:37 +02:00
parent f441b7aabe
commit cf02b3ef5c
3 changed files with 91 additions and 0 deletions
+17
View File
@@ -36,6 +36,23 @@ func (t *TCData) IsVendorLIAllowed(id int) bool {
return t.CoreString.IsVendorLIAllowed(id)
}
// Returns true if user has given consent to vendor id processing all purposes ids
// and publisher hasn't set restrictions for them
func (t *TCData) IsVendorAllowedForPurposes(id int, purposeIds ...int) bool {
return t.CoreString.IsVendorAllowedForPurposes(id, purposeIds...)
}
// Returns true if transparency for vendor id's legitimate interest is established for all purpose ids
// and publisher hasn't set restrictions for them
func (t *TCData) IsVendorAllowedForPurposesLI(id int, purposeIds ...int) bool {
return t.CoreString.IsVendorAllowedForPurposesLI(id, purposeIds...)
}
// Returns a list of publisher restrictions applied to purpose id
func (t *TCData) GetPubRestrictionsForPurpose(id int) []*PubRestriction {
return t.CoreString.GetPubRestrictionsForPurpose(id)
}
// Returns structure as a base64 raw url encoded string
func (t *TCData) ToTCString() string {
var segments []string