Hi
Is it possible to withdraw a consent from the frontend? If so, what has to be setup in the backend.
Hi
Is it possible to withdraw a consent from the frontend? If so, what has to be setup in the backend.
Hi Lars,
Yes, it's possible to withdraw consents from the front end, but you'll have to implement some of it in a razor template, because there's currently no app for this.
Example:
// Activity id var activityId = "abb52fc1-eb66-4bbb-8f78-2b3cd047c44e"; var activity = Consents.GetActivity(activityId); // Withdraw consent to an activity (current user) Consents.User.WithdrawConsent(activity.Id); // Withdraw consent to an activity (current visitor) Consents.Visitor.WithdrawConsent(activity.Id);
You can find more details and other methods in the api docs for ConsentManager.
And instead of using a hard coded activity id you could get that value from an item field.
This can be done by creating a new list field (dropdown) with SQL options (SELECT ActivityId, ActivityName FROM DataProcessingActivity) with "ActivityName" as label and "ActivityId" as value.
Best regards,
Morten
You must be logged in to post in the forum