Hiding a Form from an End User
RéponduHello,
Can somebody please assist me with the following. I used the following code below to hide a particular form from anonymous users but an end user still has access to the form.
The code is below and it is at the end of my script page.
if (HelpCenter.user.role=="anonymous")
{
$('#request_issue_type_selectoption[value="360001513253"]').remove();
$('.nesty-panel').on('DOMNodeInserted', function(e) {
$(this).children('ul').children().remove('#360001513253');
});
}
I thought I could just add the same code but replace "anonymous" with enduser like this but it does not hide the form from end users.
if (HelpCenter.user.role=="enduser")
{
$('#request_issue_type_selectoption[value="360001513253"]').remove();
$('.nesty-panel').on('DOMNodeInserted', function(e) {
$(this).children('ul').children().remove('#360001513253');
});
}
Thank you in advance for your help.
Kind Regards,
Anton
-
Hi Anton, try replacing 'enduser' with 'end_user' - that's how the role appears in the console.
-
Hello Chris,
Thank you for your reply.
I will test this when I get a chance but it may no longer be required.
Thanks.
Anton
-
Hello Chris,
This has worked.
Thank you.
Anton
Vous devez vous connecter pour laisser un commentaire.
3 Commentaires