I found a bug in my code. I fixed it. It should be working now on your site.
For reference, this is the updated code:
For reference, this is the updated code:
Code:
<script>
(function() {
document.addEventListener('DOMContentLoaded', function() {
var usergroupids = [22]; //Specify usergroup IDs here delimited by comma
var callback = function(id) {
return document.querySelector('body[data-usergroupid="' + id + '"]');
}
if (usergroupids.some(callback)) {
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
//uncomment the alert statement below by removing the // if you need to display an alert message.
//alert("Sorry, you are not allowed to do this.");
});
}
});
})();
</script>



Comment