User Guide

Removing Access to Copy & Paste

1 views 0

Some companies wish to stop end users from being able to copy and paste the content on their site, which adds another layer of protection against users sharing content.

This can be done in Zephr using an entitlement, a UI component, and a feature rule.

Removing Access to Copy & Paste

First, navigate to Entitlement Manager > Entitlements and create an entitlement called ‘Copy and Paste’.

Add the entitlement to any relevant bundles to determine which users will be able to copy and paste content. For example, if this feature is for Subscribers only, then add it to the bundle users received when they pay for their subscription.

Navigate to UI > UI Components and click Add UI Component. Then, add the following script to your UI Component:

<script>
window.addEventListener('load', function() {
window.body.addEventListener('copy', function(e){
e.clipboardData.setData('text/plain', '{{copy-paste-message}}');
e.clipboardData.setData('text/html', '{{copy-paste-message}}');
e.preventDefault();
});
});
</script>

Click Save, then navigate to Rules > Feature Rules and create a new ruler.

Within the Rule, add an Entitlement Check for your Copy and Paste Entitlement. If yes, choose No Transformation. If no, choose UI Component, and select your copy-and-paste UI component. The rule should look similar to this:

Copy the Zephr Feature Tags from the ‘Site Integration Tip’ and add these to the body of all pages you wish to limit copy and paste access to.

Save and publish your rule.